Import unit error

Issue #181 resolved
Noname created an issue

Blender 2.90 and 2.83.5

Latest version as of writting

Unable to import unit morphs:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\error.py", line 247, in execute
    self.run(context)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\morphing.py", line 703, in run
    self.getAllMorphs(namepaths, context)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\morphing.py", line 613, in getAllMorphs
    missing = self.getPass(passidx, list(namepaths.items()), props, scn)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\morphing.py", line 642, in getPass
    props1,miss = self.getSingleMorph(name, path, scn)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\morphing.py", line 565, in getSingleMorph
    props = self.buildPropFormula(asset, filepath)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\formula.py", line 651, in buildPropFormula
    if self.buildBoneFormulas(asset, exprs):
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\formula.py", line 923, in buildBoneFormulas
    if self.addPoseboneDriver(pb, tfm):
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\formula.py", line 458, in addPoseboneDriver
    self.setFcurves(pb, "", loc, tfm.transProp, "location")
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\formula.py", line 510, in setFcurves
    self.addCustomDriver(fcu, pb, init, value[idx], prop, key)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\formula.py", line 539, in addCustomDriver
    addSelfRef(self.rig, pb)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\daz.py", line 178, in addSelfRef
    pb.constaints.remove(cns)
AttributeError: 'PoseBone' object has no attribute 'constaints'

location: <unknown location>:-1

Comments (11)

  1. sc

    it’s a typo, he forgot the r of contraints, he will fixed as soon as he sees this, if you don’t want to wait go to C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\Diffeomorphic-import_daz-9ea2f153ab0f\daz.py hit F3 type “constaints” find the word and correct it save and it will be fine

  2. Noname reporter

    This is nothing urgent, for me at least.
    Thanks anyway could be useful for others.

    Usually I QA quickly import and report is something is not working to help a little bit.

    Some time ago I planed to write a regression script, when I mentioned the idea Tomas was kind enought to expose those methods etc. but unfortunately I still didn’t found a free time to do it (to much work at job). So for now I just test it out and report.

  3. engetudouiti

    Yes thanks report and infomation.

    As sc said, even though correct the typo (I could find only one place) , driver seems corrupt somehow.

    This problem is actually new one. I can not find Error in driver expression, then it is not old dependency problem.

    But units controller property values of UI, not efefct driven bone values.

    I supposed new limit Loc and Rot system efefcted, but even though I disable constrain limits, driver sitll not work to move facial bones. ^^;

  4. engetudouiti

    this commit ab24ebd new function to get evalmorphs in daz.py cause issue. I supposed it is for 2.79 but it actually change 2.8 driver expressions too. (or it need to be applied for all version?)

  5. Thomas Larsson repo owner

    Should work now.

    Morph evaluation needs to access rig properties and hence the rig itself, but only the posebone is passed to the evalmorph functions, To get the rig from the posebone, the plugin adds a constraint with the rig as the target at the top of the constraint stack.

    This used to work well because no other posebone constraints were added. However, with the new bone orientation, it is possible to impose the Limit Rotation and Location constraints from DS. But then there are suddenly several contraints in the constraint stack, and we must make sure that we can get the rig from the first one.

    Unfortunately, the code that moved the self-ref constraint to the top was complicated and buggy, This was because there is no function that just moves a constraint in B2.79. If the move function is missing, the plugin now just removes all limit constraints. This is probably not a problem since the bone is driven anyway, and only affects older Blender releases.

  6. Thomas Larsson repo owner

    Another recent change is that the evalMorphs2 function is replaced by three new ones: evalMorphsLoc, evalMorphsRot, and evalMorphsSca. This change is completely orthogonal and done for performance. The channel selection (Loc, Rot, Scale) is now done when the driver is created rather than when it is evaluated, which eliminates at least one python test in run time.

  7. engetudouiti

    @Thomas Larsson

    Thanks quick up-date. 😃

    Then One thing I recently find, if I change rotation way (Eular to quartanion), now most of drivers seems disappear,

    (but if I return, rotation mode to Eular, it revive).

    Is it your design each driver work so? Though I do not think I need to change rotation mode for Drv bones. at all.

    (I do not clear remember, if it worked before or not,, sometimes I change rotation mode to quartanion for free poze,

    then I thought, if it worked before or not. And thanks detail guide, so I can partially understand what is going on.

  8. Log in to comment