CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 03-23-2013, 01:06 AM   #1
Mat Schwartz, Mathew
University Of Michigan
Ann Arbor, USA
Join Date: Jun 2008
Posts: 154
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
Old 03-23-2013, 06:20 PM   #2
Corey Kaliszewski
Erie, USA
Join Date: Aug 2010
Posts: 43
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-23-2013, 06:20 PM   #3
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 03:06 AM.

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