Chaos Corona for 3ds Max > [Max] General Discussion

Corona Decal - maxscript commands

(1/2) > >>

harumscarum:
is there any way to add objects (by its name) to the Corona Decal (include list) with the maxscript?

Frood:
Hi, try:


--- Code: ----- 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


--- End code ---


Good Luck



harumscarum:
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

Frood:
Hi,

sure:


--- Code: ---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

--- End code ---


I'd create a macroscript from it though and check for CDecal class and/or version of CoronaRenderer first (on isEnabled() ).


Good Luck



harumscarum:
thank you so much!

Navigation

[0] Message Index

[#] Next page

Go to full version