Edit_transform not available in the C-API?
-
Hey folks,
SketchUp offers the edit_transform instance model for the model: https://ruby.sketchup.com/Sketchup/Model.html#edit_transform-instance_method - However, it seems that there's no equivalent in the C-API. I checked the documentation of the SUModelRef: https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_model_ref.html.
Am I not looking in the right place, or is there an alternative way to get the edit_transform?
Cheers,
Thomas -
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() -
@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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement