PDA

View Full Version : How to Deform Points in WorldSpace in Custom Deformer?


Windows90
10-09-2010, 02:29 AM
Hi,
I write a simple noise deformer and use a locator for accessory, to control the origin of the noise. By now the deformer works well except 2 issues:



I want my deformer work in world space. However it comes error when I use MItGeometry::position(MSpace::kWorld) , it seems that the iter parameter of virtual function deform(MDataBlock& block, MItGeometry& iter,const MMatrix& mat,unsigned int multiIndex) is initialized with a MObject rather than a DAG object? If that's true how I can get the WORLD SPACE position?
I checked maya's built-in deformer node, and nothing different, no matrix connection but all deformer works in world space well. So what's wrong with my poor deformer?

I also get another little problem. :sad:
The doc say The accessoryAttribute() method returns the attribute that is connected to the accessory shape, which in this case is offset::offsetMatrix. If the accessory shape is deleted, the deformer node is automatically deleted as well. My deformer's "referenceMatrix" attr is controlled by the locator, so I return the related MObject in accessoryAttribute(), but it not works!
When I delete the deformer, the related locator remains undeleted :eek:


Any help would be appreciated, Thanks!

Windows90
10-09-2010, 08:14 AM
Ye I got the first question, there's a matrix input provided in deform method. But the 2nd question? Help...

CGTalk Moderation
10-09-2010, 08:14 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.