Notifications
Clear all

[Closed] collapsing notactive modyfiers

Hello, I’m very new at maxscript so I’m sure this is a really basic question. Is there a way to have maxscript check for all modifier are unpin(notactive)on the current selection and then return a value based on number unactive modyfiers and collapse only unpined-notactive?

5 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

you shouldn’t collapse them… it’s safer to delete them from stack:


mapped fn leaveOnlyEnabledModifiers node = if isvalidnode node do
(	
	for k = node.modifiers.count to 1 by -1 where not node.modifiers[k].enabled do deletemodifier node node.modifiers[k]
)

Denis I’m so appreciated for help but this code dont work again like this one for unselecting
object with animation. What software are You using ?
I’m using 3dsmax2013 – maybe I should reinstal max, maybe there is some error in my max.
Every different script I evaluate works fine however I found topic in chellenge corner to create script which could object with animation and i checked all of them and olways indicate 0 aimated nodes. What can I do with this??
:banghead:

Denis, You are my hero!
I restarted my computer because windows was in sleep mode over week. Then I
removed some different scripts from max which indicate errors when max was started and it works now. This is milestone. I check your code to remove unused modyfiers however this one not work at all, can you test it?
Thank You anyway best part is done already.

The code from Denis works properly. I have tested it on max2013.


(
	mapped fn leaveOnlyEnabledModifiers node = if isvalidnode node do
	(	
		for k = node.modifiers.count to 1 by -1 where not node.modifiers[k].enabled do deletemodifier node node.modifiers[k]
	)
	leaveOnlyEnabledModifiers selection
)

I reinstal max and now it works, I’m happy, thanks. great job Denis