|
The MPxLocator draw is what is typically called.
You can also implement all of the standard compute , attributeAffects , etc. , that you would for a normal dependency node . But in order to update your data on draw , you need to request it -> which will force the compute function to be called -> which will handle all the dirty clean propogation .
Heres the rough idea :
void myLocator::draw( M3dView& view, const MDagPath& DGpath,M3dView::DisplayStyle style,M3dView::DisplayStatus status )
{
MFnDagNode fn( thisMObject() )
MPlug attrPlug = fn.findPlug( radius ) ;
attrPlug.getValue( rad ) ; // I think this forces compute to be called
... etc.
}
Check out .
http://mayaprogramming.blogspot.com/
This code did work 100% for me , but it got me 3/4 there and it is pretty cool when it works .
This guy is great . He has plenty of cutom locators . You may learn some tricks .
http://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/
|