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 CLOSED
 
Thread Tools Search this Thread Display Modes
Old 03 March 2013   #1
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?

Thanks
__________________
3D Designer-Sculpture
www.cadop.info
www.cadop.blogspot.com
 
Old 03 March 2013   #2
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
 MatchForm;
 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");
 		
 	}
 }
 
Old 03 March 2013   #3
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 09:55 AM.


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