Isotropix Forums

per object based map assignment

Discuss about expressions in Clarisse

per object based map assignment

Unread postby lafrance » Sun Mar 31, 2019 11:19 pm

Hello,
I'm trying to set up a map file to choose the correct map based on the mesh object it is attached to.
I have a crude system working right now:
object's shading variable set to

DiffuseMap = "$MapDir/Mars01_005_Color_x0_y0.png"

and map file's filename set to

DiffuseMap

while this is working, it's pretty inefficient, as I would have to add this entry to every object, and worse, add another entry for every other map.
I would like a system that is smart enough to get the correct info from the object, and construct the proper path name.
I'm pretty sure expressions offer the possibility of this more robust approach, in particular the get_name() function. I wouldn't mind adding a variable for every object that just held it's tile string, but I can't figure out how to get expressions to evaluate a locally defined variable.

Any advice, including completely different approaches, appreciated,

thanks much
lafrance
 
Posts: 12
Joined: Sun Aug 14, 2016 6:47 pm

Re: per object based map assignment

Unread postby dboude » Mon Apr 01, 2019 1:03 pm

Hi,

It isn't possible to declare a shading variable with some SeExpr snippet inside. (But I added a feature request for that)

However, you have several workflows to use shading variables and fill them automatically.
- You can make a script that writes shading variables based on the objects names.
- You can export your object from your DCC package with custom attributes defining the paths and then read those attributes to write shading variables.

Cheers ;)
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 1603
Joined: Mon Jul 03, 2017 10:51 am

Re: per object based map assignment

Unread postby lafrance » Mon Apr 01, 2019 2:43 pm

THanks Demian.
My geo is coming out of World Machine, so, afaik there is no mechanism for adding custom attributes there.
Which leaves the scripting option, which I'll look into.

thanks much

Brian
lafrance
 
Posts: 12
Joined: Sun Aug 14, 2016 6:47 pm


Return to Expressions
cron