I’m trying to learn some python coding. I’ve managed to make some progress but need to do something that I can’t see how.
I’m trying to generate an object on every edge of another object.
As an example, I can get the center of every edge on a mesh and generate a plane on edge’s center but further more I want to scale and rotate that plane along the edge, pointing up.
Searching google
I understood that I need more constraint while getting a normal vector out of an edge. Just two vertex positions are not enough. Also, I know it is OK for me to generate the plane meshes pointing up in world space. Is that enough!?!
bpy.ops.transform.rotate() gets a value and an axis…that makes me confused. I can not rotate the generated meshes as I want in my script.
I would really appreciate if somebody can help me.
Edit: I’ve added 3 screenshots to illustrate what I’m trying to achieve.
Thank you YHOYO for the answer, i really appreciate you taking the time to answer.
Although your script works as intended It seems I was not able to clearly ask my question. Generating a plane was just as an example. I actually want another object to rotate and scale along an edge, that’s why I’m trying to use the " bpy.ops.transform.rotate() "
Also your script doesn’t help if a vertex is shared in multiple edges and vertices are placed in different Z positions (not flat)
One thing I can do is, I can take the generated planes face normal and rotate my object using that. Although not optimal, it can work.