Select objects once at time and do an action once for each object
Hi!
I have some ojects in an unhidden layer and I'd like to select an object, do an action, select another, do the same action, and so on for all the objects inside the unhidden layer.
The action in my case is to apply a modifier (and change some parameter) that cannot be applied in the same time to all selected objects.
Thanks in advance.
Comments
Thank you very much! It
Thank you very much!
It works, and I have also understood it :) thanks to you.
"Switch on" I mean the little bulb next to the modifier name that you can use to Enable/Disable it.
By default mu "custom modifier" is applied with the bulb off, so it doesn't affect the geometry. I have to manually "swicth on" the bulb/enable it.
The code:
&.modifiers[#MODIFER].enabled=true
seems not to do that inside your code
www.ossosso.com
...
;)
bga
Ehy man! Thank you very very
Ehy man! Thank you very very much for your really clear support!
Your script works :)
Just some info for better apply to my use:
-Could be this action applied to all visible object instead of layername? 'cause otherwise I should each time manually copy/past layername into the script. If not doens't matter.
-This should be the core of the action:
addModifier o (TurboSmooth iterations:2 isolineDisplay:on)
And as I can easily understand it adds the turbosmooth modifiers to all nodes with iterations of 2 and isoline on. I notice that if I change modifier name to add another kind of modifier I have to leave some other code after the modifier name, if I write:
addModifer o (MODIFIER)
I receive the errore message:
"Unable to convert: MODIFIER to type: Modifer"
It works if I write
addModifier i (MODIFIER iterations:2)
even if the MODIFIER hasn't "iteration" parameter, just to understand
-It's possible to add a second command after adding the modifier to Switch On it? 'Cause by default it's applied switch Off.
Thank you very very much anyway!
www.ossosso.com
...
TurboSmooth in the code below is not name but modifier class.
To get modifier class of your custom modifier do next:
- assigne that mode to some object
- run this in listener
- let's say you get CustMod
- now to add this modifier try
- to see all properties of custom modifier run
I don't understand your last question about "Switch on"
bga
...
With this fn you can assigne en modifier (TS in this case) to all objects which layer is not hidden. Unhidde some layers in layer manager and run this code
bga
Ok, well, here is a simple
Ok, well, here is a simple scene saved in max2013:
http://www.ossosso.com/scambio/test.max
What I'd like is that to the 3 spheres in layer "esp_nb1_lp" (which is the unhidden one) could be applied the Turbosmooth modifier in a consecutive way:
-select first sphere -->apply Turbosmooth
-select second sphere -->apply Turbosmooth
...
At the end each of them has a turbosmooth modifier, not instanced.
Then I will hide the first layer, unhide the second one and repeat the script.
I need that because I have to apply a commercial modifier on geometries (not installed within 3dsmax) which cannot be applied to multiple objects.
We can try with turbosmooth for now, it will be easy for me next to substitute your "turbosmooth code" with "other modifier code"
modPanel.addModToSelection (MODIFIER ()) ui:on
Tnank you very much!
www.ossosso.com
...
Ok. I will explain you step-by-step what you need to do
bga
...
bga
Thank you very very much
Thank you very very much barigazy for answering me.
Unfortunatly I'm not a max script user, I can sometime intuitively or with some copy/past obtein what I need.. but this is not the case :)
I don't know how to use your code.
Can you explain me please? Not all the script, but only how to make it work, I have an error once executed it.
Thanks again.
www.ossosso.com
...
If U are not used maxscripts in this way then is very difficult to explain.
This is just example and U need to modify it for your needs.
So maybe is better to post here examle file and describe what exactly U want to achive. Then I will try to correct my code
bga