Select CAT layer via MaxScript?

Select CAT layer via MaxScript?

peter.spence
Enthusiast Enthusiast
1,015 Views
3 Replies
Message 1 of 4

Select CAT layer via MaxScript?

peter.spence
Enthusiast
Enthusiast

I'm trying to wire 2 parameters via MaxScript. However, I have a few layers in the CAT Layer Manager. It seems that only the layer that is selected is then visible to the scripted parameters. So I'm trying to find a way to select the CAT Layer Manager layer in the script too.

Here's an example using a layer named Animation (with a Master object wiring to a Slave CAT object):

paramWire.connect $Master.rotation.controller[#X_Rotation] $Slave.transform.controller.LayerTrans.controller.Animation.controller.Rotation.controller[#Z_Rotation] "X_Rotation"

Everything works unless I have previously selected another layer in the CAT Layer Manager.

Any ideas?

Kind regards,
Peter Spence

Putty Studios
Characters & Visual Effects
www.PuttyStudios.com
0 Likes
Accepted solutions (1)
1,016 Views
3 Replies
Replies (3)
Message 2 of 4

ads_royje
Alumni
Alumni
Accepted solution

Hi @peter.spence ,

 

to be able to select a CAT layer via Maxscript, it can be done by selecting it by its index ID.

For instance, with CAT parent selected

$<CAT parent>.numLayers

will return the numbers of layers.

$.<CAT parent>.selectedLayer

will return the index of the current selected layer.

 

$.<CAT parent>.selectedLayer=2 

will select the layer 2

In documentation:
http://help.autodesk.com/view/3DSMAX/2020/ENU/?guid=GUID-A2663EFC-8DBE-4F18-9327-C1AFF6019BA1

I hope this can help,

Regards,

0 Likes
Message 3 of 4

peter.spence
Enthusiast
Enthusiast

That's great, thanks!

I'd been trying to do all sorts of MaxScript madness and completely over-complicating myself. Your help brought me back down to sanity, and solved the problem.

Kind regards,
Peter Spence

Putty Studios
Characters & Visual Effects
www.PuttyStudios.com
Message 4 of 4

ads_royje
Alumni
Alumni

Awesome to read 🙂

Thank you for your feedback! 

0 Likes