Notifications
Clear all

[Closed] On Select – Go to Previous Modifier-Subobject?

Does anyone know of, or can you help with the following script:

  • On selecting an object it selects the same modifier and sub-object that was selected before you deselected the object.

ie. You’re working on Object A in Edge mode of an Edit Poly modifier. You select a different object. You then reselect Object A and it instantly returns to Edge mode of the Edit Poly modifier.

10 Replies
 lo1

the approach you’d have to take would be different depending on whether or not you need this to be sticky in the scene.
you just need a simple selection changed callback which records the active modifier for each object and selects the modifier in the newly selected object
The question really is if to save data in a custom attribute for each object, or in a global dictionary with object handles and modifier indices.

Hi Rotem.

Ok, I’m quite confused – I’m not a coder. What do you mean by it being ‘sticky’?

Yes, it needs to record the active modifier (and sub-object), then when the object is deselected and then reselected, it needs to call on that recording.

 lo1

By sticky, I mean it would stay in the scene and next time you open the file it would remember the selected modifier data.

It doesn’t need to be sticky.

Do you know of any such scripts, or if it isn’t too complicated, would you be able to create one?

1 Reply
 lo1
(@lo1)
Joined: 11 months ago

Posts: 0

I’ll try to find time to do it, busy week though, so not sure.

@Rappy: I’ve found and used that script already. The author said, if he gets time, he will try to make this too.

@lo: Thanks. That would be great if you can. It would be a very useful tool.

 JHN

But isn’t the problem that once in subObject mode you simply can’t select another object because you have to leave subObject first. How to remember it’s last SO state then.

Just wondering,
-Johan

1 Reply
(@playdo)
Joined: 11 months ago

Posts: 0

Yes, I don’t know how, but it would need to recall the second from last selection (that’s if having an object selected without being in a sub-object mode counts as a selection). Is this much more complicated than recalling the last selection?

 lo1

It is tricky.
You could implement a #ModPanelSubObjectLevelChanged callback to record last SO state, but I guess you’d have to only record it if a selectionSetChanged callback triggered X seconds afterwards.