Notifications
Clear all

[Closed] Any scene object scale callback?

I’m looking for a way to add a callback for when an object/objects are scaled. I don’t mean specific objects, I’m talking about any objects in the scene. So whenever any object in the scene is scaled. I’ve found the “when transform obj changes do”, but from trying that out, it only seems to work on specific objects that you designate at the time of adding the event handler rather than any objects added to the scene. I’ve been searching through here and the help for a while now and don’t know if this is even possible.

Cheers,

Cg.

10 Replies
1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

just curious… what do you do with scaled objects?

How about a NodeEventCallback with the property geometrychanged and then check if your scale is still [1,1,1] ?

1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

right idea. but it’s better to use controllerOtherEvent

Thanks nysuatro, I don’t think a geometry change is what I’m looking for though as i would like to have it work on other things like helpers. I’ll look into the control other event. Cheers Denis.

1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

the system doesn’t fire the geometry change event on a transform change

I’m trying to stop people from scaling objects in scenes.

1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

i’ve expected this answer :). everything is much easier. just lock scale controller for all nodes that must not be scaled. probably they are created by your tool. so lock them on creation. do you know how to lock a controller?

You’re always thinking one step ahead. Yeah I know about locking controllers. But i don’t think that would be the solution for me as i still want people to be able to animate the scale of objects. Just not lazily scale them when they should be using either subobject scale or xform modifiers. The objects can be created by everyone. So I was assuming you meant locking the scale controller of all objects on creation with a callback ? Which would also stop the ability to animate the scale. Am I correct? Or maybe it would be good to lock them all on creation and then people would have to go manually unlock them which is more work than scaling things in less destructively annoying ways. I’ve got some things to think about. Thanks Denis.

Cheers,

Cg.

to prohibit scaling of all objects in the scene sounds like a paranoia for me
it makes sense just to protect only specific nodes. as i said if the object created by your tool you can easy lock its scale controller on creation. if you want to lock objects by some specific criteria and this object can be created manually you can listen node created (or added) event, and lock all objects those match the criteria. i don’t know how undo/redo mechanism will work in this pipeline, but i don’t see real problems.
using the transform change event you can catch the fact of change, but you cannot prevent the change.

Paranoia is generally based on unfounded “feelings” rather than experience.