|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| Subclass MPxLocatorNode but register kDependNode?
|
|
|
Has anybody tried subclassing from MPxLocatorNode but registering the new type as MPxNode::kDependNode? I’d like to do this:
class A : public MPxLocatorNode {
virtual MPxNode::Type type() const { return MPxNode::type() }
};
class B : public A { ... }; // register A as kDependNode
// register B as kLocatorNode
This way A can be a regular DG node, but B can be a DAG node. (If I derive A from MPxNode, and B from MPxLocatorNode, then I can’t have B as a subclass of A). The only method of MPxLocatorNode that overrides something in MPxNode is ‘type’, so I thought about defining A::type to make sure it runs the MPxNode version instead.
Has anybody tried something like this, and observed any ill effects? It appears to work, but who knows down the line…
thanks
|
|
|
|
A locator node already has compute functionality from kDependNode so I’m not sure why you would want to do this.
|
|
|
chadmv 09 April 2010 05:28 PM
A locator node already has compute functionality from kDependNode so I’m not sure why you would want to do this.
I know, but.... I have a class hierarchy in which it’s natural for B to be a subclass of A. It also makes sense (in terms of what I’m doing) to have B as a locator, but not A. I can have both as locators or DG nodes, by deriving A from MPxLocatorNode or MPxNode, but if I want B to be a locator but A a DG node, then I’m stuck. Obviously I can’t change MPxLocatorNode to virtually-inherit from MPxNode. I tried this technique of registering A as a kDependNode and it worked fine, up until the point I wanted to save/load the scene, then Maya started crashing. I’ve had to reorganize my class hierarchy instead, which is a shame.
|
|
|
|
|
|