MPxConstraint (or lack of) 2003-11-27 - By Olivier Renouard
Back Hi and thanks for the reply
> Note that constraints are generally derived from MPxTransform, not MPxNode, > but there's really nothing to stop you from deriving directly from MPxNode > if you don't need any of the extras that MPxTransform provides.
Didn't know that, though they're of course DAG object as they get grouped under the constrained object usually so I should have thought about it.
> The geometry constraint achieves this amazing feat by connecting to a > special attribute on shape nodes called 'geometry', which is explicitly > intended for geometry constraints. >
True, bad exemple, let's say I want to replicate the "soft connection" behavior they have aquired in Maya 5.0 (didn't do much with Maya 5.0 API yet, so there might be more ways to achieve things like this that weren't available in Maya 4.5), by that I mean, constrained objects can still be moved in the 3D view (couldn't in 4.5, very few connection displayed this behavior in 4.5, like attribute blenders and animation curve). I remember a discussion on this list about the fact it was impossible to define / get attributes to show this sort of behavior ("soft connection" instead of default "hard connection") in Maya 4.5.
> In other words, all of Maya's shape nodes have been specially modified to > work with the geometry constraint. Since we, as 3rd-party developers, > don't have the ability to modify the internal workings of Maya's existing > nodes, we are necessarily limited in the sort of constraint behaviours we > can implement. But we can use the existing hooks to create variations on > existing behaviours. >
Yes, actually if I want to write a "distance constraint" (object must stay at fixed distance from a given point") I could use the geometry constraint by passing a sphere as geometry. In fact it can be done as a workaround without any need for API work. I was just wondering if there couldn't be a more elegant / straightforward solution than building / passing geometry and have Maya do an expensive geometry test whereas a simple implicit sphere equation would do. (being able to use implicit primitives with a modified geometry constraint would be nice I think)
Olivier
Quoting :
> =========================================================================== > - deane Gooroos Software: Plugging you into Maya > > Visit http://www.gooroos.com for more information
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-archive: <http://www.highend3d.com/maya/devarchive/>
|
|