Anybody got an idea? - Transform Orientation Towards Cursor.

Hi.
I am doing some very complex geometry for an architecture project and I use a lot of Custom Transform Orientations. (Global, Local, Normal, Custom 1, custom 2… etc.).

It hit me that in my case and many others I could get rid of all these custom Orientation by having an option to use the 3d cursor as “target”. It would make vertex slide possible and be very useful in many other cases as it would also work in object mode moving objects in one specific arbitrary direction. See Screenshot.

http://dl.dropbox.com/u/1161045/TransToCursorIdea.jpg

My question: While trying some to get into Python I do not have the necessary skill yet to make this feature, but is it even possible to engage the Transform Orientations with the Python API or is there maybe some obscure way to do this already?

In case nobody knows maybe somebody knows how difficult this would be for a ne pythonist to practice his skills on…?

Best Regards to all.
Ejnar

If you just want to move a vertex on one end of an edge towards another vertex on that edge do you really need a python script? You can just change the pivot point to Active element and scale one vertex towards the other. No need to keep repositioning the curser. If you also select view edge lengths you can also scale the vertex so the line is a specific length
Quick Demo: http://screencast.com/t/7vL3XfC6z50

That was fast :slight_smile:
And actually a working solution for my situation (thank you) even though it is going to take some workarounds as I would have liked to move many vertexes in the same direction. But hey with such a fast prompt I cant complain :smiley:
Anyway I hope I (in the not so far future) or someone else could implement it as it could help on moving objects and precis (CAD precise) modeling.
Thank you Richard.

Try this:
Split the 3DView so you have two 3DViews.
In the left one select the vertices of the edge that is the direction you want your vertices to move along. Rotate the view so the two vertices become one in the 3DView. The other 3DView rotate so you can see from a side if the movement is correct.

Go to first 3DView and Change from Global to View in the Transform Orientation. Select the vertices you want to move and press G key and then Z twice (we are in View mode and this way we select Z of view mode) and now move up or down and you see in the 3DView to the right your vertices moving in the direction you want, and in the left 3DView you don’t see your vertices moving at all if you did it well.

Yes, is not “mathematically” exact but at least is something I think.

But +1 to the mokup with the “To Cursor” you posted. I really think is a great idea the “To Cursor” mode in Transform Orientation for moving a selection of vertices in one direction.

And thanks Richard Marklew because I was using the pivot to move vertices. Never in my life I would have thought about the active element !!!

@Bao2 - Good idea as well. You kind of have to do some awkward thinking to get around this one but i just tried and it actually worked. If I use your method but instead of rotating the view by mouse I use a camera with a “track to” constraint to an Empty. I then place the camera and empty to get my direction and use your “View” transform orientation idea.

It works but… I would prefer just to position the 3d cursor though… :slight_smile:
Who do you think might know what parts of the API we would have to touch to do this…?

Can a wise person tell me how I access the Transform Orientation matrix data through python? I need to make the Transform Orientation point towards the location of the cursor. Thought it a good way of getting to know 3d matrices and blender py API :slight_smile: Thanks

Hi enjnaren,

Well I don’t know about wise, but I can point you in the right direction.

bpy.context.scene.cursor_location

Allows you to find the location of the 3D cursor. Also,

bpy.context.scene.orientations

Is where you’ll find the orientations available in your scene. Hope that helps.

Cheers,
Truman

PS This IS a really nice project to get started on for the Py API! Script should be ~15 lines long I think and useful!