Is there any way to get a custom attributes' rollouts?

Is there any way to get a custom attributes' rollouts?

AndyVanDalsem
Enthusiast Enthusiast
213 Views
5 Replies
Message 1 of 6

Is there any way to get a custom attributes' rollouts?

AndyVanDalsem
Enthusiast
Enthusiast

Does anyone know if there's a way to ask custom attributes what rollouts it has?
If you already know the rollout's name you can access it directly like this:

ca = (custAttributes.get $ 1) -- get def instance

ca.rollout_01 -- get rollout directly by name
--> Rollout:rollout_01
showProperties ca -- ask for properties
--> .prop_01 : float -- only returns parameters
getPropNames ca
--> #(#prop_01)

 

Only the ca's params show up when you inspect it's properties. I want to be able to get a ca's rollouts dynamically. Is that possible? 

0 Likes
Accepted solutions (1)
214 Views
5 Replies
Replies (5)
Message 2 of 6

denisT.MaxDoctor
Advisor
Advisor

The question is, what do you want to do once you get the rollouts? 

0 Likes
Message 3 of 6

AndyVanDalsem
Enthusiast
Enthusiast

I'm playing around with putting the rollouts in a subRollout of another dialog/rollout. It's probably not the smartest idea, but I'm just experimenting for fun.

I actually have it working, I just wondered if I could do it with dynamically collected rollouts instead of manually collected rollouts.  

Next, I wanted to try adding a button that would take the rollout from the modify panel and pop it out to a floater, then return it to the modify panel when the floater is closed.  I was just curious if I could do it and what would happen. 🙂

AndyVanDalsem_0-1781819120393.png

 

0 Likes
Message 4 of 6

denisT.MaxDoctor
Advisor
Advisor
Accepted solution
 

In general, the answer is no — you cannot just take a rollout from the Command Panel, including the Modify Panel, and then simply add it back there manually.

When a rollout is added to the panel, a certain registration process takes place. That registration does not happen if you try to do it manually.

Technically, it may be possible to reproduce this behavior, but you would need to follow all the internal registration rules. And that cannot be done through MaxScript.

The only reasonably safe thing you can do is create your own rollout with a sub-rollout, and then add your own rollouts into that sub-rollout.

You can also add rollouts from Custom Attributes, but only as long as those Custom Attributes have not yet created an instance and have not already been added to the panel through Max’s own internal mechanisms.

And if it ever seems like you've managed to trick the system, my advice is: don't believe it. 

It will eventually show up as a bug somewhere. 

0 Likes
Message 5 of 6

AndyVanDalsem
Enthusiast
Enthusiast

You can also add rollouts from Custom Attributes, but only as long as those Custom Attributes have not yet created an instance and have not already been added to the panel through Max’s own internal mechanisms.


Ah yeah, I can see this now. The rollout breaks if there's more than one instance of the CA in the scene. Oh well, it was just an experiment to see what would happen. Thanks for the info!

0 Likes
Message 6 of 6

denisT.MaxDoctor
Advisor
Advisor

In fact, your experiment with the CA rollout makes a lot of sense.

Just create an instance of the CA and show its rollout with createDialog. You will see that editing the rollout parameters is undoable, and the dialog is floatable.

😉

0 Likes