Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Query Xform at certain time?

Query Xform at certain time?

Anonymous
Not applicable
1,389 Views
1 Reply
Message 1 of 2

Query Xform at certain time?

Anonymous
Not applicable

Hi,

 

A simple question here,

 

we wrote a script that samples the worldspace Xform position based on a frame range using the cmds.currentTime command to indicate the frame we want to sample.

 

all works well, but we are looking for a way to speed up the sampling so we can skip the viewport evaluation for every frame and still sample the correct values. 

 

in other words we are looking for a 'time' atribute in the x form command 🙂 

 

what would be the easyest way around this problem?

 

thanks.

 

Tristan 

 

 

 

 

 

 

0 Likes
1,390 Views
1 Reply
Reply (1)
Message 2 of 2

Shkval3d
Participant
Participant

Hi there. 

 

I use c++ API for it... 

but you can write it on Python too, I guess

 

 

 

 MStatus WrightBoneAnim(MDagPath &bonePath, MMatrixArray &mArr, int sf, int ef) // sf - start frame, ef - end frame 
{                                                                               // mArr - array of matrices for object
// in given time range MStatus status; mArr.clear(); MTime time_1; time_1.setUnit(MAnimControl::currentTime().unit()); for (int i = sf; i <= ef; i++) { time_1.setValue(i); status = MAnimControl::setCurrentTime(time_1); CHECK_MSTATUS_AND_RETURN_IT(status); mArr.append(bonePath.inclusiveMatrix()); } return MS::kSuccess; }

 

0 Likes