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® Softimage® / XSI SDK / C++ API: Getting the Lenght of TimeLine (Frames Count)
  RSS 2.0 ATOM  

C++ API: Getting the Lenght of TimeLine (Frames Count)
Rate this thread
 
56024
 
Permlink of this thread  
avatar
  • Total Posts: 101
  • Joined: 31 August 2010 07:17 AM

How to get the current frames count (the lenght of time line) in the Sofimage project, please?

I can not find the correct function for it.

Thank you.



Replies: 0
avatar

You have to go through the PlayControl property.

For example, here’s a snippet from the Crosswalk DotXSIConverter example code:

// get the starting frame from XSI
 
float startframe;
 
startframe COMMANDS::GetValue(CString(L"PlayControl.In"), time.GetTime());
 
l_pSceneInfo->SetStart(startframe);

 
// get the ending frame from XSI
 
float endframe;
 
endframe COMMANDS::GetValue(CString(L"PlayControl.Out"), time.GetTime());
 
l_pSceneInfo->SetEnd(endframe);


Replies: 0
avatar

Thanks, Stephen.

As usual, great help. :-)



Replies: 0
avatar

This is, how I did it in C++:

// Get the current project
 
Application app;
 
Project ProjectActive app.GetActiveProject();

 
// The PlayControl property set is stored with scene data under the project
 
CRefArray aPropertiesList ProjectActive.GetProperties();
 
Property propertyPlayctrlaPropertiesList.GetItem(L"Play Control") );
 

 
int nStartFrame = (int)propertyPlayctrl.GetParameterValue("In");
 
int nLastFrame = (int)propertyPlayctrl.GetParameterValue("Out");


Replies: 0