Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / double transform on the move command
  RSS 2.0 ATOM  

double transform on the move command
Rate this thread
 
37527
 
Permlink of this thread  
avatar
  • Location: Honolulu, HI
  • Total Posts: 34
  • Joined: 07 March 2008 05:39 AM

I am getting a weird double transform error in Max 2010.  I am running a simple Max Script on a standard Character Studio Biped rig.  Basically it finds out the position of the root $Bip01 node and stores it.  Then it checks a helper bone called “Bip01 L Toe0Nub” and “Bip01 R Toe0Nub” to see which one is lower.  It uses the lower bone’s Z position to determine how much to offset the Biped’s Z position and get the feet on the ground.  My code worked fine in Max 2008 but seems to run into a weird error in 2010:

--check to see which foot is lower to the ground
if ($Bip01_R_Toe0Nub.pos.$Bip01_L_Toe0Nub.pos.z)
   then zOffset 
($Bip01_R_Toe0Nub.pos.* -1)
else zOffset ($Bip01_L_Toe0Nub.pos.* -1)

--puts Biped in "move all mode" to be able to put global offsets on its position.  
--
root $Bip01 node should be at X and Y at 0.  

select $Bip01
$bip01
.transform.controller.moveallmode =  true 
offsetCoords 
biped.getTransform $bip01 #pos
move $bip01 [(offsetCoords.* -1),(offsetCoords.* -1) ,zOffset]
biped
.collapseMoveAllMode $bip01.transform.controller
$bip01
.transform.controller.moveallmode =  false

The problematic line of code seems to be:

move $bip01 [(offsetCoords.* -1),(offsetCoords.* -1) ,zOffset]

When testing it, it seems to move the biped by twice what the values are (eg zOffset * 2).  Can anyone figure this out or is Max 2010 still too new?  Luckily I still have 2008 installed so I can run the script but this is a really annoying bug.



- Howard Hsu http://www.linkedin.com/in/howardab234

Now using:
Windows XP 64 Pro v2003 SP2 (yes XP64 is still around)
Core 2 Quad CPU Q6600 @ 2.4GHz
2GB RAM
NVidia GeForce 8800 GTX

Max 2008 x64
Maya 2008 64
MotionBuilder 7.5

Replies: 0
avatar

Wow, so I found a workaround to get this to work but it adds two extra lines of code:

offsetCoords biped.getTransform $bip01 #pos
move $bip01 [(offsetCoords.* -1),0,0]
move $bip01 [0
,(offsetCoords.* -1) ,0]
move $bip01 [0
,0,zOffset]

Basically I’m doing the move command for each axis, instead of all in one command.  When I try to move it in one line using the variables offsetCoords.x, offsetCoords.y, zOffset for (X,Y,Z, respectively) it does a double transform… if anyone can figure this one out and explain why it’s happening that’d be awesome.  Thanks!



- Howard Hsu http://www.linkedin.com/in/howardab234

Now using:
Windows XP 64 Pro v2003 SP2 (yes XP64 is still around)
Core 2 Quad CPU Q6600 @ 2.4GHz
2GB RAM
NVidia GeForce 8800 GTX

Max 2008 x64
Maya 2008 64
MotionBuilder 7.5

Replies: 0