THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/09/2011 at 08:12, xxxxxxxx wrote:
Cinema 4D Version: 12
Language(s) : C++ ;
I made attempts to move a Hair within the calc_constraint Callback of the HairPluginObjectData. It seems that I can't simply move a Hair (by moving the base-point), they seem restraint by the guides.
So I tried to move the guides itself, but setting a new global matrix (SetMg()) has no effect. Do I need another callback, or is there a "correct" way of moving a single Hair in space?
On 27/09/2011 at 06:56, xxxxxxxx wrote:
I don't know if it's possible to unroot the hairs. It seems as though the hooks are meant to just offset the hair points. I will ask the developers.
On 27/09/2011 at 07:32, xxxxxxxx wrote:
What does it mean, to unroot a Hair? Is it just possible to move a hair when moving the object it is rooted on? I think I don't understand the concepts of hair yet. As I saw in the example (HairGenerator), those hairs don't seem to have a root, as the type is HAIR_ROOT_TYPE_NONE.If it is possible to have a hair without root, can those hairs not be moved at all?
On 27/09/2011 at 07:39, xxxxxxxx wrote:
Every hair guide has a root. This is basically the first point of the guide. It determines the start position and direction of the guide. As I've found out you can set it through HairGuides::GetRoot/SetRoot.
Here a simple example which flattens all guides along the X axis.
static Bool _ConstraintFn(BaseDocument *doc, BaseList2D *op, HairObject *hair, HairGuides *guides, HairGuideDynamics *dyn, Vector *oldpnt, Vector *newpnt, Real *invmass, LONG pcnt, LONG cnt, LONG scnt)
if (invmass[j]==0.0) continue;
newpnt[j].x = 0.0;
LONG gcnt = guides->GetCount();
for (i=0; i<gcnt; i++)
HairRootData rdata = guides->GetRoot(i);
rdata.m_P.x = 0.0;
guides->SetRoot(i, rdata, TRUE);
On 27/09/2011 at 11:18, xxxxxxxx wrote:
Ok, changing the root works fine!