Chaos Corona Forum

General Category => Off-Topic => Topic started by: aaouviz on 2021-02-04, 11:10:56

Title: 3DS Max script help
Post by: aaouviz on 2021-02-04, 11:10:56
Off topic, I know. But this is my fav forum and I know you lot are super smart, away from the Corona world too...

I'm wondering if anyone knows how I can script an action to toggle OFF snaps when I provide a hotkey.

I can TOGGLE snaps easily enough with a script, but I want to disable (aka turn off) snaps even if it's already off. The problem with the toggle is that if I press my hotkey it might turn it on when I actually want it off.

The purpose of this is that I want to combine an "Unhide all" with Toggling snaps OFF so my heavy scenes don't freeze up when I unhide a lot of geometry.

I hope this is clear! Thanks for any tips.
Title: Re: 3DS Max script help
Post by: Frood on 2021-02-04, 13:48:08
but I want to disable (aka turn off) snaps even if it's already off.

Seems like you need just "snapmode.active=false"?


Good Luck



Title: Re: 3DS Max script help
Post by: aaouviz on 2021-02-04, 15:37:14
Right you are sir! Big thank you!

(Though, I swear I did try this... must have got some combination of it wrong somewhere.)

Thanks again.
Title: Re: 3DS Max script help
Post by: aaouviz on 2021-09-09, 09:34:10
Hi hi,

Another maxscript related question seeing as you answered the last so well :)

I want to turn off a specific layer (the layer is called 100_SS) with a simple little MaxScript

I know this must be possible, but my maxscript skills are not quite up-to-scratch...

Thanks in advance!
Title: Re: 3DS Max script help
Post by: clemens_at on 2021-09-09, 10:55:10
try this:

Code: [Select]
((layerManager.getLayerFromName "100_SS")).ishidden = true
Title: Re: 3DS Max script help
Post by: aaouviz on 2021-09-09, 13:15:16
Seems to work!

Thanks mate, appreciate it :D
Title: Re: 3DS Max script help
Post by: aaouviz on 2021-09-09, 14:16:47
Ok, now I'm here to bother you smart folk once again...

I have this following script:

Code: [Select]
((LayerManager.getLayerFromName "100_SS")).current = true

macros.run "Layers" "SceneExplorerSetActiveLayerAsParentLayer"

((LayerManager.getLayerFromName "0")).current = true

It's intended to set my "100_SS" layer as current, move the selected objects to that layer and then set default layer back as current. It works perfect :D

However, I also want to make this more useful by turning it into either a button or keyboard shortcut. I've done this previously with other snippets of code with the following:
Code: [Select]
macroScript AACollapseLayers
category:"1AAScripts"
toolTip:""
(CODE GOES HERE

This doesn't work. ā€ˇParenthesis "( )" in the wrong place, or something, but no matter what I try, I can't get this to work. Any tips?

Much appreciated!
Title: Re: 3DS Max script help
Post by: clemens_at on 2021-09-09, 14:31:58
Code: [Select]
macroScript AACollapseLayers category:"1AAScripts" -- buttonText:"insert here"
(
((LayerManager.getLayerFromName "100_SS")).current = true
macros.run "Layers" "SceneExplorerSetActiveLayerAsParentLayer"
((LayerManager.getLayerFromName "0")).current = true
)
Title: Re: 3DS Max script help
Post by: aaouviz on 2021-09-09, 15:12:16
Amazing, thank you again mate.

Super helpful stuff, my workflow is buzzing now thanks to your help