PDA

View Full Version : Getting/Setting an image map's "High Value" & "Low Value"?


bobKotlinski
03-25-2010, 09:43 PM
Hi!

I'm a scripting noob, so please be patient!
I just started learning perl so that I could write a simple (I hope) script for modo.
We use GoZ to go between zBrush & modo here.
We have been instructed to "standardize" our displacement map "high" & "low" values to 100% & -100% respectively. GoZ, however uses a fixed displacement distance of 50 cm & then sets the "high" & "low" values appropriately to match the sculpted mesh (usual around 3%).
I want to write a script that querys the "High Value" so that I can set it to 100% and appropriately set the Displacement Distance to correspond to the new value.

I am having a terrible time even querying & setting these values!http://www.3dallusions.com/forums/images/smilies/eusa_wall.gif

Here is my script, if someone would be willing to look at it:

#perl
#-------------------------------------------------------------------------------
#Get the Values
#-------------------------------------------------------------------------------

lxout("Getting image map low value");
my $sourceMinimum = lxq("item.channel imageMap$min ?");
lxout("Getting image map hight value");
print "error" if ($sourceMinimum is > 0);
my $sourceMaximum = lxq("item.channel imageMap$max ?");
lxout("Getting displacement distance");
my $sourceDispdist = lxq("item.channel advancedMaterial$displace ?");

#-------------------------------------------------------------------------------
#Do the math
#-------------------------------------------------------------------------------

lxout("Calculating change in Displacement amount");
my $dispDist = $sourceMaximum * $sourceDispdist;

#-------------------------------------------------------------------------------
#Set the values
#-------------------------------------------------------------------------------

lxout("Setting the Low value to -100");
lx("item.channel imageMap$min -1");
lxout("setting the High value to 100");
lx("item.channel imageMap$max 1");
lxout("Setting the new Displacement ammount"); lxout("Setting the new Displacement ammount");lx("item.channel advanceMaterial$displace [$dispDist]");
Thanks
!

bobKotlinski
03-26-2010, 06:35 PM
I got the answer here (http://forums.luxology.com/discussion/topic.aspx?id=45250)

CGTalk Moderation
03-26-2010, 06:35 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.