Chaos Corona for 3ds Max > [Max] Corona Goodies - User Contributions

Macroscript to quickly add/remove Scatter Edge Trimming map

(1/3) > >>

Frood:
Since there is ChaosScatter with Edge Trimming support now, here is a macroscript to quickly add and remove the ChaosScatterEdgeTrimming map to and from materials. Select a material (or multiple materials) in SME and execute it. If any scene object is selected, the material(s) of all selected objects will get processed instead. Supported materials are Multimaterial, Standardmaterial, CoronaPhysicalMtl and CoronaLegacyMtl.

Assign this script to two different hotkeys, where one hotkey uses the "SHIFT" key as part of the key combination. If "SHIFT" is pressed while invoking the script, "Remove" mode is active.

Example:
Assign this script to "Alt+Ctrl+E" and to "ALT+Ctrl+SHIFT+E". If you then press "Alt+Ctrl+E", "Add" mode is active. If you press "ALT+Ctrl+SHIFT+E", ChaosScatterEdgeTrimming maps will be removed instead.


We will probably not need those EdgeMaps anymore using Corona v10, but until then...


Good Luck


Edit:
Changed description to match version 0.3, attached version 0.3:
Required hotkey modifier key changed from "ALT" to "SHIFT" to trigger remove mode. Restored node selection in SME after removing EdgeTrimming maps. Removed console spam.
Edit:
Attached version 0.4:
Fixed undefined active SME view after starting Max without having SME opened once

romullus:
Thank you very much!

PROH:
Thank you :)

I'm running the script without hotkeys, and it adds Edge Trimming map(s) without problems. But I can't get it to remove them again.

Is this possible without hotkeys?

Corona 9
Max 2020

Frood:

--- Quote from: PROH on 2022-10-25, 15:16:01 ---I'm running the script without hotkeys

--- End quote ---

You mean as a toolbar icon? Then the only modifying key which would work is Shift (one reason why I prefer to hotkey it). Alt and Ctrl do not allow to run an icon. So you could change the line


--- Code: ---if keyboard.altPressed then mode="Remove" else mode="Add"
--- End code ---

in "on execute()" to


--- Code: ---if keyboard.shiftPressed then mode="Remove" else mode="Add"
--- End code ---

Then, a standard click on the icon would add the maps, and Shift+click on the icon would remove them. Hope it helps,


Good Luck




PROH:
Thank you.
I use hotkeys instead. It works very well, and simplifies the use of edgetrim enormous.

Great script :)

Navigation

[0] Message Index

[#] Next page

Go to full version