xyz coordinate updates during iteration

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  03 March 2013
xyz coordinate updates during iteration

I have an object (its a long rectangular box), one end of it is attached to a curve with a motion path, the motion path is baked in.

then i iterate through each frame in the timeline by updating the current time. Each frame I rotate the box, then i set a new keyframe.

Each frame i need to query the xyz coordinates of the top and bottom of the box. The problem is maya goes through the entire timeline with the box in the single orientation and at the end updates the box with its rotations (using xform).

I need maya to update the box after each rotation because the xyz coordinates rely on the new rotation. I tried refresh() but does nothing. Is there a way to force this or something?

3D Designer-Sculpture
  03 March 2013
Something like this?
if(`window -exists PivotQuery` == 1) deleteUI PivotQuery;
 window -title "Query Pivot" - w 190 -h 41 -sizeable false PivotQuery;
 formLayout -numberOfDivisions 100 MatchForm;
 button -label "Run Me" -command "QueryPivot" -w 150 -h 23 QueryPivot;
 formLayout -edit
 	-attachForm QueryPivot "top" 9
 	-attachForm QueryPivot "left" 20
 showWindow PivotQuery;
 global proc QueryPivot()
 	for ($x = 1; $x < (`playbackOptions -q -max`); $x++)
 		currentTime $x;
 		float $pivot[] = `xform -q -bb -ws pCube1.scalePivot`;
 		float $MinX = `getAttr pCube1.boundingBoxMinY`;
 		float $MaxX = `getAttr pCube1.boundingBoxMaxY`;
 		float $MinY = `getAttr pCube1.boundingBoxMinY`;
 		float $MaxY = `getAttr pCube1.boundingBoxMaxY`;
 		float $MinZ = `getAttr pCube1.boundingBoxMinZ`;
 		float $MaxZ = `getAttr pCube1.boundingBoxMaxZ`;
 		print("pCube1 MinX: " + $MinX + " pCube1 MaxX: " + $MaxX + "\npCube1 MinY: " + $MinY + " pCube1 MaxY: " + $MaxY + "\npCube1 MinZ: " + $MinZ + " pCube1 MaxZ: " + $MaxZ + "\nPivot(XYZ): " + $pivot[0] + " " + $pivot[1] + " " + $pivot[2] + "\n");
  03 March 2013
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 05:54 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.