Added in Python API transform orientation & transform position matrix

Hi, everybody. I wrote on RCS about adding data such as transform orientstions & transform position(Transform Pivot Point) to the Python API, but all this was ignored. I think this is such a necessary thing for developing Addons. Currently, very few add-on developers use tools (WorkSpaceTool), although if you have orientation and position data, you can make a lot of cool add-ons for blender. Now I have to calculate matrices for meshes on my own, this is very slow through Python code. You also want to make gizmo for different types of objects, and you need data from orientation and transformation matrices everywhere. Sorry to write here, but could you consider adding this data to the API?

I think it’s so simple, because it’s all already in the blender code

I wrote this in blender chat but they are clearly not up to me))

1 Like

I’m pretty sure they’re already in here:

of course this is not the case here(

:thinking: What’s that first member then? Well, adding API stuff isn’t as hard as I expected the first time I did it. In fact, I did it on accident-- MakesRNA does all the heavy lifting for you. Defining RNA in C is a lot like defining a bpy.props object. It seems like it would be simple to add.

can you help me with this? I wrote to the developers, they are all busy and say that try to do it yourself,but I am very bad at C/C++. I need you to guide me. I’m not asking you to do this, just help with the direction, specifically where it can be in the blender code, how to write it correctly and where to write it. I would be very grateful to you.

Sure, I’m willing to help if I can. It might be more complex than it seems, though. The first thing to do is find out where the information is that you want to expose to Python. Then you probably want to make it a member of the Scene object, so you’d have to expose the information to the Scene and add it to its RNA. I think… I’ve mostly stayed in Rigging and Animation land, so I’m not 100% sure.
Do you have Blender building yet? If not, what OS are you using?
Start by searching around here. I don’t know for sure what term to search, but you might be able to figure it out by following the menu that does the thing - so, maybe run Blender from the command line with --debug-wm (Window Manager) to find out that the pie menus are “VIEW3D_MT_pivot_pie” and “VIEW3D_MT_orientations_pie”. Follow those to see that the Pivot is a property of the scene.tool_settings object, and the transform orientation is a property of the scene.transform_orientation_slots… Keep tugging that ball of string till you find the actual assignment, if you can. Note that most of the C code does assignment with functions, so it might not look familiar. I can’t poke around in this any longer just now, but that should give you an idea of how to start looking.

Yes, I have a blender build with git.
as far as I understand transform orientations lies (logically) in transform_orientations.c there is also a .h file.
but I don’t quite understand which part is responsible for the final result(for the final matrix)