Use Copy transform constrain instead of "real parenting relation" (experimental)

Issue #299 closed
engetudouiti created an issue

It is related with #296.

the problem is when user generate new posable bones as child of driven bones, (like all tiny facial bones and drv bones)

real deform bone set as child of drv bones. (it simply copied then set relation to move free)

the problem is, when the child bone is used as driver variable, (like eye bone transform will drive drv-eyelids bone transform )

or Lthing bone will be used as driver variable for jcm, unfortunately, if they have parent drv bone, basically the rig lost function to change shape key (jcm) values. or can not move eyelids anymore.

the behavor may change wheter use drv-bone as driver variable, or use pose bone as driver variable, but after all, it may only work when target bone is moved as local. that means, if set driver target for real pose bone, even though the parent drv bone moved, the transform is not used, then jcm not work any more.

or if set driver target for parent drv bone, even htough we move child pose bones, the transform not circulated to change jcm shape keys. it may change when we apply “make“pose all bone”, but after all it not work for both.

we need to change jcm shape key, when we move drv bone, and child pose bone. it need to move with both.

To correct it, one way is change driver expression, with add new variables. it may be solved for most of case.

but real improvement should be count parent bone (drv bone) transform then add it for child pose bone transform, so we need visual transform which only include parent drv bone,then all bone driver varialbe only set for pose bones. (never use drv bones variable, so can keep code clean and simple. then it may not depend when we use all pose bones posable. because if never use drv bone transform as driver target variable. (drv bone should be used to set driver but not used for driver target variable)

To achive it, at current add on use “real parent-child relation” to generate drv and pose bone pair, then if change it as “child of constrain”, copy transform constrain, (mix before original) now it move as child of drv, still move free at same time, if we set the child pose bones transform as driver target variable., it now count constrained value correctly. = drv bones transform value + current pose bones transform value as visual transform value, then it is used to drive jcm or drive another drv-bones.

I test with custom pectoral jcms , then change drv-pectoral and pectoral (real pose bone) relation to use “child of” constrain. and import jcm. now it work for both case =, when drv-pectoral move by collar, and when I manually move pectoral bone, the transform value correctly circulated and can chagne custom jcm shape key value.

It seems simple what I expected, but may be it need more test, with complex hieralchy , but basically we only need 2 steps.

after import default rig, then import morphs, or import jcms, then make all bone posable,

1 generate new drv bones which will be moved by controller or other bones relation. on same hieralchy. (you simply need to copy current pose bones. and set driver if it need for drv bones eg pose controller or facial unit as same as before.

2. set “child of “ constrain for deform bones. the “constrain parent” should be drv bone which duplicated from self. with keep same hieralchy. (so do not need to change hieralchy any more when generate drv bones, I suppose)

if I change current rig, now it can set jcm shape key value correctly , when drv pectroal moved by collar, and when I manually pose pectoral bone.

you can see the jcm only use pectoral variable for expression. but I do not pose pectoral at all. only pose drv pectroral by collar bone (it has driver to pose drv-pectoral) .before it never work. (shape key value never change because local transform value of pectoral bone = 0, even though they are posed with drv-bone)

basically it is all,, if plug in already set driver target for drv bones, (maybe it happen when we ues all bones posable) we need to , change target varialbe from drv bone to pose bone transform. then use same expression of the driver. as same as before.

(no need to add new variable, but just need to confirm, we only use real pose bone transform as variable for driver expresison, if it include drv bone transform, it need to change to real pose bone transform. with use “Local” space option (it is used for current driver settinig, then you may no need to change it)

Though it may need test hard for other cases, but basically I think it make things more simple. because we can keep same logic when set driver for shape keys or bone rotation (for pose controller), we only use real pose bone transfrom as driver expression. then it still work when drv bone moved by controller, or we manually pose weight bone .

I think if it cause some peformance issue, but maybe code becom more simple. because it need to change hieralchy when generate drv bones. and no need to change expression. etc.

(but as I said it is my experimental suggestion, so not push hard, at current I like this idea though, and may hope it work better)

Comments (3)

  1. engetudouiti reporter

    I change priority, because new commit already use “add new variable for both bones, and circulate driver expression.” then basically it should work. (Though I still can not confrim it should work when user mix use controller and pose bones with 3 rotation axis,,maybe it may show a little difference from what daz rig ERC show in ds)😀

    And I hope new release version offer as stable version, so do not hope hard change untill I can confirm it should work better.

    (though I still not see child of constrain show unstable behavor, (I know there seems some problem when I use it for obj constrain, etc, or set 2 target as parent,, about this case, the target only need to set one bone, and keep default setting, so basically it seems almost same, when we use real parent relation. (parent drv bone and movable pose bone)

    Anyway I understand, those hard change often make add on un-stable, so not think it is major request. at current I only test with private usage, (eg exchange eye bones and eye-drv bone relation as constrain, and test it how it work)

    but someday, I think if it may make drv more simple and hieralchy clean. so remain this. And The “child of” constarain seems offer many new usage I feel. which I have not seirously tried before.

  2. engetudouiti reporter

    Current new import morph system solve issue with change expression + add new bone to catch transform value with constrain thanks.

    then I close this suggestion. Though I still think copy transform constrain and off set without child relation may work better to make scale driver + free move bone. But add on already change drastically about morph system, so not hope to change rig drastically untill all morph related issue solved.

  3. Log in to comment