summaryrefslogtreecommitdiffstats
path: root/tools/globalcode/utility/nodehelper.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/globalcode/utility/nodehelper.h')
-rw-r--r--tools/globalcode/utility/nodehelper.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/globalcode/utility/nodehelper.h b/tools/globalcode/utility/nodehelper.h
new file mode 100644
index 0000000..ef0842a
--- /dev/null
+++ b/tools/globalcode/utility/nodehelper.h
@@ -0,0 +1,37 @@
+#ifndef NODE_HELPERS
+
+#include "precompiled/PCH.h"
+
+namespace NodeHelper
+{
+
+inline int OverrideNodeColour( MObject& node, int defaultColour )
+{
+ int colour = defaultColour;
+
+ MStatus status;
+ MFnDagNode fnDag( node );
+ MPlug overColour = fnDag.findPlug( MString( "overrideColor" ), &status );
+ if ( status )
+ {
+ overColour.getValue( colour );
+ if ( colour != 0 ) //The override is Active...
+ {
+ colour--;
+ if ( colour < 0 )
+ {
+ colour = 0;
+ }
+ }
+ else
+ {
+ colour = defaultColour;
+ }
+ }
+
+ return colour;
+}
+
+};
+
+#endif \ No newline at end of file