Chaos Corona Forum
Chaos Corona for 3ds Max => [Max] General Discussion => Topic started by: harumscarum on 2022-05-10, 13:45:09
-
is there any way to add objects (by its name) to the Corona Decal (include list) with the maxscript?
-
Hi, try:
-- create a decal object:
mydecal=CDecal name: "Testdecal"
-- print the include/exclude list:
mydecal.excludeList
-- create some node...
mybox=box name: "Testbox"
--- ... and add it to the node array:
appendifunique mydecal.excludelist mybox
-- create another...
my2ndBox=box name: "Anotherbox"
-- ... and add it to the array using its name:
appendifunique mydecal.excludelist $Anotherbox
--- see the updated excludeList:
mydecal.excludelist
-- list all properties of the decal object:
show mydecal
Good Luck
-
wow, thank you very much!
I wonder if the following is also possible:
- Run script to select bitmap file
- Corona Decal created with the dimensions of the bitmap (1px=1m)
That would be very useful tool to create real-world-size Corona Decal objects in one click
-
Hi,
sure:
bm=selectBitMap caption:"Select bitmap to create a decal object from."
mydecal=CDecal sizeX:bm.width sizeY:bm.height name: ((getFileNameFile(bm.filename) as string)+"_Decal")
decalmat=CoronaPhysicalMtl name: ((getFileNameFile(bm.filename) as string)+"_Decal_Material") baseTexmap: (Bitmaptexture name: (getFileNameFile(bm.filename) as string) filename: bm.filename)
mydecal.material=decalmat
I'd create a macroscript from it though and check for CDecal class and/or version of CoronaRenderer first (on isEnabled() ).
Good Luck
-
thank you so much!
-
Is there any way to clear include/exclude list by maxscript command for all Corona Decals objects in the scene?
-
Hi, try
for o in getClassinstances Cdecal do o.excludeList=#()
Good Luck