Hi
I’m completely new to blender scripting.
I want to make maps with roads. I am trying to find a way to make the roads “flat” (still climbing hills etc, not rotating).
This could be done by scaling the road to 0 in the z direction, but that would eliminate all elevation.
I want to select the edges crossing the road and scale them to 0 in the z direction one by one.
This is the script
It runs, but nothing happens.
import Blender
Blender.Window.EditMode(1)
obj = Blender.Object.GetSelected()[0]
me = obj.getData(mesh=1)
for edge in me.edges:
z_ = (edge.v1.co.z + edge.v2.co.z) * 0.5
edge.v1.co.z = z_
edge.v2.co.z = z_
Blender.Redraw()