#include <mobu-python-api.h>
Real-time profiling information for a specific task. Profiling information can be collected for:
When profiling a scene within a MotionBuilder session you can discover what tasks are being performed when and for how long. You can use this information to troubleshoot lengthy or repetitive actions, and use MotionBuilder more efficiently. A task is defined as a definite piece of work within MotionBuilder such as the evaluation of a character. If the same task is run numerous times it is called a task cycle. From within a scene, the hierary and dependents of the scene make up the task cycles. A task cycle spends its time computing a specific task within a task parent cycle. A task parent cycle is a hierarchy of individual task cycles, where the parent and child relationship is known to MotionBuilder and displayed in the profiling center. For example, these are all task cycles which are all parented to each other; Eval is parent of TransformNode_Active, which is a parent of Constraint, which is a parent of Character, which is in turn a parent of TransformNode_Active. This is because the evaluation is called for one model which triggers evaluation of the character which then calls the evaluation of the rest of IK/FK models. When an evaluation starts, it calls the evaluation of the character, the time will be computed for time spent on the sample. Then possibly another character is evaluated, so again the time will be computed for the time spent on this sample. This time will be added to the previous sample since that evaluation has not finished yet. The evaluation here is parented, since they both have started but not finished, all children samples are summed. When the evaluation stops, you change the sample for the children. Note: The evaluation dependency/order will be different for each scene. As you can see profiling of task cycles is done by collecting samples. Samples are added to one inside parent sample. The number of samples collected is controlled by the profiler buffer size property. Here are the steps to add profiling into a constraint, a device, or any other class that uses real-time evaluation: 1) Declare FBProfiler_CreateTaskCycle( MyConstraint, 0.5, 0.5, 0.5 ) in MyConstraint.cxx, before the constructor and AnimationNodeNotify function. 2) Set up FBProfiling_SetupTaskCycle( MyConstraint ) in the constuctor MyConstraint::MyConstraint(). 3) At the beginning of MyConstraint::AnimationNodeNotify create the variable: FBProfilerHelper lProfiling( FBProfiling_TaskCycleIndex( MyConstraint ), pEvaluateInfo ); The sample for task will start at the creation of FBProfilerHelper object and stop at the destruction of this object, when returning from AnimationNodeNotify will be done.
Public Member Functions | |
__reduce__ () | |
int | GetIndex (FBProfileTaskCycle arg1) |
Get the unique registration index for each cycle. More... | |
str | GetName (FBProfileTaskCycle arg1) |
Get the name of task cycle. More... | |
FBColor | GetColor (FBProfileTaskCycle arg1) |
Get the color of the task cycle. More... | |
tuple | GetAvgMinMaxUsage (FBProfileTaskCycle arg1) |
Get the task cycle's average, minimum and maximum usage. More... | |
bool | IsStarted (FBProfileTaskCycle arg1) |
Test to see if sampling has started. More... | |
int | GetChildCount (FBProfileTaskCycle arg1) |
Get number of child tasks. More... | |
FBProfileTaskCycle | GetChild (FBProfileTaskCycle arg1, object arg2) |
Get child task based on specific index. More... | |
__init__ (...) | |
__init__ | ( | ... | ) |
Python Docstring:
Raises an exception This class cannot be instantiated from Python
C++ Constructors:
The reference documentation for the following C++ symbols may contain additional relevant information.
__reduce__ | ( | ) |
tuple GetAvgMinMaxUsage | ( | FBProfileTaskCycle | arg1 | ) |
Get the task cycle's average, minimum and maximum usage.
Python Docstring:
GetAvgMinMaxUsage( (FBProfileTaskCycle)arg1) -> tuple
C++ Signature:
void GetAvgMinMaxUsage(double & pAvg, double & pMin, double & pMax)
Results will vary on buffer size. When profiling is disabled all values are set to 1.
pAvg | Average time spend for computation of task (in micro seconds). |
pMin | Minimum time spend for computation of task (in micro seconds). |
pMax | Maximum time spend for computation of task (in micro seconds). |
FBProfileTaskCycle GetChild | ( | FBProfileTaskCycle | arg1, |
object | arg2 | ||
) |
Get child task based on specific index.
Python Docstring:
GetChild( (FBProfileTaskCycle)arg1, (object)arg2) -> FBProfileTaskCycle
C++ Signature:
ORSDK2018::FBProfileTaskCycle * GetChild(int pIndex)
Can return NULL if child index is not used.
pIndex | Child index. |
int GetChildCount | ( | FBProfileTaskCycle | arg1 | ) |
Get number of child tasks.
Python Docstring:
GetChildCount( (FBProfileTaskCycle)arg1) -> int
C++ Signature:
int GetChildCount()
Task cycles are organized in a hierarchy which is dependent on the scene. Samples can be cumulative in the parent task cycle, or independent. For example, all character evaluation samples will be cumulated in one evaluation cycle.
FBColor GetColor | ( | FBProfileTaskCycle | arg1 | ) |
Get the color of the task cycle.
Python Docstring:
GetColor( (FBProfileTaskCycle)arg1) -> FBColor
C++ Signature:
const float * GetColor()
Used in profiling Center for drawing.
int GetIndex | ( | FBProfileTaskCycle | arg1 | ) |
Get the unique registration index for each cycle.
Python Docstring:
GetIndex( (FBProfileTaskCycle)arg1) -> int
C++ Signature:
int GetIndex()
str GetName | ( | FBProfileTaskCycle | arg1 | ) |
Get the name of task cycle.
Python Docstring:
GetName( (FBProfileTaskCycle)arg1) -> str
C++ Signature:
const char * GetName()
bool IsStarted | ( | FBProfileTaskCycle | arg1 | ) |
Test to see if sampling has started.
Python Docstring:
IsStarted( (FBProfileTaskCycle)arg1) -> bool
C++ Signature:
bool IsStarted()