@dan rathbun said:
The C API is mainly written to act upon files.
There is only some limited things you can do with "live" models.
Currently, the C API cannot be used to modify the active model.
You can get the active edit path via: SUModelGetActivePath()
... and from it the transform via: SUInstancePathGetTransform()
Thanks, Dan, for the information! I solved it in my code by having a ModelObserver, implementing onActivePathChanged, and passing it to my C-extension code.
Even though you cannot modify the active model, you still need to know the edit transformation for some cases. If a user opens a model to edit, if you query the instance transformation, it will be a world-coordinate transformation instead of a transformation relative to the parent. My C code assumes transformations relative to the parent, so I must calculate that using the edit transformation. You probably already knew this, but I'm putting it here for posterity.
Cheers,
Thomas