On 03/03/2013 at 04:37, xxxxxxxx wrote:
Cinema 4D Version: 13
Platform: Windows ; Mac ;
Language(s) : C++ ;
I'm making an ObjectData plugin to use as a deformer, and I'm trying to implement a falloff tab (in a similar way to the falloff tab that appears in the 'displacer' and 'surface' deformers).
I've been getting there by using the 'C4D_Falloff' class - following the instructions in the SDK and calling the C4D_Falloff functions from the appropriate places in my ObjectData's code. However I'm still having a couple of stumbling blocks, and hopefully someone here knows some more about it and can offer me some advice.
Here are my issues:
The SDK says that the C4D_Falloff is able to get and set its own parameters from the object's container. I haven't been able to get this to work, I can manually get the data from the BaseContainer and then call SetMode() and SetData(), but this isn't ideal as those functions don't seem to allow me to pass the full range of settings from every falloff type.
The SDK suggests that I call the C4D_Falloff's CopyTo() function within my ObjectData's CopyTo() function to ensure that the handles work - however I'm not sure where to get the 'C4D_Falloff*' dest variable this function needs, as it isn't passed in the NodeData CopyTo() function (that gets passed a 'NodeData*' dest, can the 'C4D_Falloff*' be found from there somehow? Or maybe one of the GeListNode pointers?)
On 03/03/2013 at 08:07, xxxxxxxx wrote:
For 2), you should have the C4D_Falloff* stored in your derived-NodeData class as a member. Then you only need to get it from there on both your NodeData source and dest.
I haven't used the falloff in C4D yet. I will be dealing with this soon myself so will get back with more information if necessary.
On 03/03/2013 at 13:35, xxxxxxxx wrote:
That makes sense, thanks Robert.
On 04/03/2013 at 13:23, xxxxxxxx wrote:
That's worked perfectly, thanks Robert. I'm still not having any luck with point 1, if you do find out anything when you start working with the falloff would be great to know.
On 09/03/2013 at 05:18, xxxxxxxx wrote:
I think I've figured it out, I thought I just had to call InitFalloff once, but I have to call it whenever the data is dirty to ensure the falloff updates. I'm still testing stuff out, but it seems to be working pretty well.