Author Topic: Corona Decal - maxscript commands  (Read 1823 times)

2022-05-10, 13:45:09

harumscarum

  • Active Users
  • **
  • Posts: 32
    • View Profile
    • ZNAK
is there any way to add objects (by its name) to the Corona Decal (include list) with the maxscript?

2022-05-10, 14:37:35
Reply #1

Frood

  • Active Users
  • **
  • Posts: 1903
    • View Profile
    • Rakete GmbH
Hi, try:

Code: [Select]
-- 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



Never underestimate the power of a well placed level one spell.

2022-05-10, 14:53:06
Reply #2

harumscarum

  • Active Users
  • **
  • Posts: 32
    • View Profile
    • ZNAK
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

2022-05-10, 15:58:20
Reply #3

Frood

  • Active Users
  • **
  • Posts: 1903
    • View Profile
    • Rakete GmbH
Hi,

sure:

Code: [Select]
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



Never underestimate the power of a well placed level one spell.

2022-05-11, 21:49:08
Reply #4

harumscarum

  • Active Users
  • **
  • Posts: 32
    • View Profile
    • ZNAK

2023-04-08, 00:01:40
Reply #5

harumscarum

  • Active Users
  • **
  • Posts: 32
    • View Profile
    • ZNAK
Is there any way to clear include/exclude list by maxscript command for all Corona Decals objects in the scene?

2023-04-08, 12:16:05
Reply #6

Frood

  • Active Users
  • **
  • Posts: 1903
    • View Profile
    • Rakete GmbH
Hi, try

Code: [Select]
for o in getClassinstances Cdecal do o.excludeList=#()

Good Luck



Never underestimate the power of a well placed level one spell.