ScriptSpot

Forum topic · Scripts Wanted

Clear Multiple channels from an object

By bolegna · 2011-12-10

Description

Hello, I need to clear multiple channels from an object.
I tried this as a test:

for x = 5 to 50 do
channelInfo.ClearChannel $ x

[this one has 50 map channels, but I need to clear from a specified number to a another specified number]
It applied all 45 "uvw mapping clear" modifiers each with an ascending number to the stack but only cleared one of them (50) when I collapsed the stack.
If I do this manually in the map channel info dialogue but right clicking each channel and clearing it, it works – but I don’t want to do that for lots of objects with 90 channels each 

Thanks for any help

Comments (3)

ChannelInfo.ClearChannel

MaximilianPs · 2018-08-28

Sorry for the 5 years necromancy but I guess it could be useful ;=)

Based on selection, this will clear all Channel, you could add the channel number as your n needs.

This is useful 'cause unity fbx exporter will crash 3DS Max if channels are present!


for i in selection do 
(
  channelinfo.clearchannel i 2
  channelinfo.clearchannel i 3
)

Obviously:
DO A BACKUP BEFORE TRY IT !!!

I cannot be considered responsable for headache, monitor explosion, heart attacks

The solution

LittleLordPotala · 2012-01-27

We must directly add the modifier in a descending loop :


for i = 50 to 5 by -1 do 
(addmodifier $ (UVW_Mapping_Clear mapID:i); collapsestack $)

A workaround...

LittleLordPotala · 2012-01-27

As the function "channelInfo.ClearChannel" does not work inside a loop,
I made an interface with spinners.

In the "channel" spinner, just enter the last channel of the list and it
automatically delete this channel, then click and hold-down the down-buton of the spinner and it will delete the channels very fast.

I added a "stop to" spinner as a protection to keep all the channels greater than this value.

Attachments