GithubHelp home page GithubHelp logo

Mistake in Morphs.py about daztoc4d HOT 4 OPEN

daz3d avatar daz3d commented on June 3, 2024
Mistake in Morphs.py

from daztoc4d.

Comments (4)

danielbui78 avatar danielbui78 commented on June 3, 2024

Thanks, very much!

from daztoc4d.

brucek5 avatar brucek5 commented on June 3, 2024

Hi danielbui78,
I found the mistake while making a standalone script that “bakes” the linked mesh morphs into the Morph tag when importing a FBX file. In my script, I created a null called “Removed Morph Meshes” at the top of the project, and rather than deleting the meshes, I simply moved them to the null after the conversions. If I don’t need the meshes, then I delete the null and the meshes with it. Rather than re-inventing the wheel, I used your Morph.py code, hence how I found the mistake.

I also removed the two lines:
if "Default:" in morph_name:
continue
The default pose doesn’t need to be a linked mesh.

Another change I made was to change the morph tag to just points:
pm_tag[c4d.ID_CA_POSE_POINTS] = True
pm_tag[c4d.ID_CA_POSE_P] = False
pm_tag[c4d.ID_CA_POSE_R] = False
pm_tag[c4d.ID_CA_POSE_S] = False

Position, Rotation and Scale are for using the tag as a “Correctional PSR Morph” where each morph strength is automatically driven by the Position, Rotation and Scale of a linked joint (which the Bridge isn’t using). I my script, it works fine, but if I make the same change to the Bridge code, for some reason I haven’t figure out, none of the morphs don’t do anything. So since having Position, Rotation and Scale in the Bridge doesn’t add much memory, I left it as is.

Bruce

from daztoc4d.

danielbui78 avatar danielbui78 commented on June 3, 2024

Sorry, I'm not fully understanding your last message. Can you give a test case scenario with step-by-step instructions which I can run before and after making your proposed code modifications to understand the effects? Also, I am assuming you propose to add the additional instructions here?

pm_tag[c4d.ID_CA_POSE_POINTS] = True

from daztoc4d.

brucek5 avatar brucek5 commented on June 3, 2024

danielbui78,

Just ignore my last message, doesn't hurt anything leaving it the way it is and the extra memory is very, very small.

FYI - The Pose P, R, S settings being "True" (a PSR Morph Tag) is for when you want Cinema 4D to perform joint correction for you based on the position, scale, and rotation of a supplied joint (or object). Since the Bridge is not providing links to joints, it's only using Points. If the DAZ3D JCM morphs where a linear function (which they're not) to joint rotation, this would be a preferred means to control the morph strength because the morph tag itself would be performing the tasks that all the joint pythons scripts are doing. You'll see in the Morph Tag they're extra PSR variables being shown for variables that normally are not shown when using the tag for just user defined and controlled morphs like the Bridge is using it for. In addition, if you make them all false, then the morph tag will clear all it's memory (because it's a very different type of Morph tag) requiring all the morphs to be re-installed into the tag. That's why when I modify the Bridge code to what I posted above, the morphs stopped working because the morphs we're already populated.

Bruce

from daztoc4d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.