mcjMirrorMorph - This script builds mirrored morphs on (for now) figures with good symmetry

2»

Comments

  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    That's really cool. I notice one bounce doesn't quite make it all the way to the primitive box. Is this another fabulous script?

  • mCasualmCasual Posts: 4,607
    edited June 2015

    RAMWolff said:
    That's really cool. I notice one bounce doesn't quite make it all the way to the primitive box. Is this another fabulous script?

    it does make it very precisely to the box

    it's a script but just for fun, not universal,
    it only works for objects dropped from an altitude of 5 meters on a planet where gravity os 10m/s2
    and where the ball and the floor don't absorb energy

    note that mcjCycleFilter has a built in parabolic effect, that can be used to make things bounce

    
     var node = Scene.getPrimarySelection();
     var tick = Scene.getTimeStep();
     var playRange = Scene.getPlayRange();
     var startFr = playRange.start / tick;
     var startEn = playRange.end / tick;
     var pi = new DzVec3( node.getWSPos( startFr * tick ) );
     var vi = new DzVec3( 0, 0, 0 );
     var a = new DzVec3( 0, -500, 0 );
     dt = tick / 4800;
     var ti = startFr * dt
     var p = DzVec3( pi );
     for( var i = startFr; i <= startEn; i++ )
     {
      var t = i * dt - ti
      var t2 = t * t;
      p.x = pi.x            + vi.x * t;
      p.y = pi.y - 500 * t2 + vi.y * t;
      p.z = pi.z            + vi.z * t;
      node.setWSPos( i * tick, p )
      if( p.y <= 0 )
      {
       pi.y = 0;
       vi.y = 1000;
       ti = i * dt
      }
     }

    the interesting points are, i was able to make the drop distance an exact number, 5m., the impact velocity too, 1m/s, and the drop/bounce duration 1s.

    bouncez.jpg
    980 x 652 - 191K
    ploc.jpg
    746 x 660 - 23K
    Post edited by mCasual on
  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Neat. Your very much a genius with so much. You must dream in code! lol

  • mCasualmCasual Posts: 4,607
    edited June 2015

    RAMWolff said:
    Neat. Your very much a genius with so much. You must dream in code! lol

    i think it's because i'm impatient to finish scripts i announced this winter and get back to the physics simulator ( bike jumps ! )

    amyintheskywithprimitives.gif
    400 x 300 - 667K
    sane.jpg
    1920 x 1080 - 311K
    posp.gif
    600 x 450 - 143K
    Post edited by mCasual on
  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    *giggles* Bouncy bounce bounce bounce

  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Casual said:
    i'll test the idea right now
    note that often, the things i do in my "laboratory" in 15 minutes take days to be made usable for everyone

    1 - Fig 1. - i load Goth-Amy (Aiko3) and place her in an eXtreme pose, wearing low-poly short pants
    2 - export the posed shorts figure using the obj Exporter's Daz presets under the name mcjA3Shortants6_rThighZRot70degrees.obj
    3 - Fig 2 - Import mcjA3Shortants6_rThighZRot70degrees in Blender, making sure the "Keep Vertex Order" and PolyGroups" options are On
    4 - Fix the problems
    5 - Export it as mcjA3Shortants6_rThighZRot70degrees_Morph.obj making sure the "Keep Vertex Order" and PolyGroups" options are On
    6 - i select the root bone of the pants
    7 - I go in the DS menu Edit / Figure / Morph Loader pro
    8 - well i was able to import the morph, but, a) unfortunately i had changed the pose on the left side and it became part of the morph and b) the morph strength to apply the morph is 5% instead of 100%
    9 - taking it da capo
    10 - Turns out that's not the problem, the problem is i didnt see/use that "“reverse deformations”" option RamWolf mentioned
    11 - Fig 3 : there it is
    12 - Fig 4: There it is, and the morph strength is 1 ( 100%) as expected
    13 - i wont do the JCM rigging
    14 - figuring how to mirror the morph using the upcoming mcjObjServer


    So about ready to try this. The morph is already saved out as JCM-SideSide-Right.OBJ so I do NOT pose my figure's leg? I should probably do that since the saved morph is saved as a posed morph and then I would use the Reverse Deformations. Unless I'm to save out the morph with the leg down but turn the morph up to 100%? Part of the issue I have with doing that is that there is a "Default Shape" that's set and locked and hidden to take the pants from a very squared looking pants to a desirable shape. So I guess I would first need to unlock that morph and zero it out and then proceed?

  • mCasualmCasual Posts: 4,607
    edited June 2015


    So about ready to try this. The morph is already saved out as JCM-SideSide-Right.OBJ so I do NOT pose my figure's leg? I should probably do that since the saved morph is saved as a posed morph and then I would use the Reverse Deformations. Unless I'm to save out the morph with the leg down but turn the morph up to 100%? Part of the issue I have with doing that is that there is a "Default Shape" that's set and locked and hidden to take the pants from a very squared looking pants to a desirable shape. So I guess I would first need to unlock that morph and zero it out and then proceed?

    the pose and the morph settings don't matter
    the script only looks at the non-posed geometry and at the morph deltas which are not affected by anything

    once your right-side morph is integrated in the pants
    through the use of Morph Loader Pro,

    you select the pants, start the script
    in the drop down list, you select your custom morph name

    automatically a name for the mirrored morph is suggested
    the same name, prefixed with the word "mirrored_"
    but you are free to change that name

    then you click the "Build Mirror Morph" button and
    watch the progress bar

    when its done the progress bar disappears
    and there's a message in the log saying "The deed is done"

    if your morph object modified many body parts,
    then there will be more than 1 morph to process
    up to 12 in the case of pants

    by default, the new morph(s) which we created just now ) is/are in the "Morphs" section of the figure's parameters

    by naming the new morph something like "My Morphs/lThighlThighBend"
    you may be able to get it added to a new group named MyMorphs

    i'm not sure, but i think you'll have to rig the JCMlThighBend master control to
    as many morphs as there were body parts affected by the morph
    like, lThigh, hip, lButtock etc ...

    Post edited by mCasual on
  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Thanks. that helped allot. First try.... taking a while because of the vert count I'm sure...

    Progress.jpg
    383 x 382 - 20K
  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Hmmm, didn't work. Left the under part of the pants with a huge poke-inwards issue and the top of the thigh is still showing poke through's....

    I may be able to salvage this though in ZBrush with some smoothing as the wrinkles were something I really wanted to work out and they seem to be good. I guess your mentioning the item needs to be perfectly symmetrical and these pants because of the fly in the front are not as I had to move allot of verts around to achieve the button fly.

    NotWorking.jpg
    1416 x 564 - 275K
  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    OK... this is really really weird. I'm not complaining but I screwed up loading the figures into ZBrush and because the GoZ bridge is buggy I had to save out my DS file, shut down and restart and reload the scene to get the temp files cleared out of where ever they are stored for ZBrush export via the bridge... low and behold, aside from a few little verts that need smoothing the whole underside is now just about perfect and the poke throughs on the top of the thigh is gone.

    Why is that? The initial dial up was set to 100% and that huge "Poke-Inwards" happened. Now it's gone after a reload? Weird.

  • mCasualmCasual Posts: 4,607
    edited June 2015

    RAMWolff said:
    OK... this is really really weird. I'm not complaining but I screwed up loading the figures into ZBrush and because the GoZ bridge is buggy I had to save out my DS file, shut down and restart and reload the scene to get the temp files cleared out of where ever they are stored for ZBrush export via the bridge... low and behold, aside from a few little verts that need smoothing the whole underside is now just about perfect and the poke throughs on the top of the thigh is gone.

    Why is that? The initial dial up was set to 100% and that huge "Poke-Inwards" happened. Now it's gone after a reload? Weird.

    not really sure maybe it's related to the order in which the morphs are applied

    maybe your second export did a better job of preserving the vertex order

    maybe you did not rig the hip/buttock/thigh morphs the same way , and the morphs were battling each other

    also, in recent years, sometimes when experimenting with morphs ( when i did the mcjA3BodyCon, i had to tweak the morph strength, even just 0.01% before exporting them, else Daz Studio was telling me "that morph contains nothing"

    natural.jpg
    1000 x 1000 - 94K
    shapes4.jpg
    1857 x 867 - 589K
    Post edited by mCasual on
  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    I only did the one export though. Just one run of the script with fingers crossed. When I applied it to the side to side bent leg that's when I got all the poke throughs but I saved and reloaded the scene and low and behold the morph was mostly good. I did have some issues that were easily fixed in ZBrush, resaved out. Used the Edit mode to delete the new morph and then brought in the fixed version and reapplied it and it's good. I'm generally happy with the script's abilities. I'll look forward to the second part when you get that finished to speed up the process and I think you mentioned it will give a better mirrored morph to areas that are not 100% symmetrical.... or did I read that wrong?

  • DaremoK3DaremoK3 Posts: 798
    edited December 1969

    Hey Casual,

    I encountered an error with the script trying to use it in DS 4.5.1.56.

    I know you work hard to make your scripts backwards compatible all the way back to 1.x series, but I am wondering if the 4.x version of the script will only work with 4.7 or 4.8.

    The devs make a lot of changes that mess with the small details between series versions, so maybe this particular function line in the script does not mesh with 4.5's API.

    I tried on three separate models, and all three yielded same result; Line 192 error.

    Here is a screenshot of the Log file for Genesis:

    mcjMirrorMorph_Error.jpg
    766 x 184 - 45K
  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Hmm, not working all of a sudden. I made a "foot bend up" JCM for the right foot.. Got the JCM set up, exported and saved the pants out. Saved the scene and restarted the program to clear any cobwebs out and started your script and found the .....

    OK, restarted the program a couple more times and now it's building the morph. Really weird behavior there.

  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Hmmm, attempting to use the script again for a different morph called an MCM (which I have NO IDEA how to set up but wanted to get them done and saved out....) and same issue... twice the script runs, it's done in a matter of milliseconds and of course the morph doesn't nothing compared to when it kicks in and does it's thing that usually takes about 5 minutes and I'm pretty happy with the results. What it can't get exactly right I can usually fix up in ZBrush but right now this existing bug isn't producing anything that works when it's done in it's milliseconds speed! :-|

  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Yup, script if DOA... I've rebooted the computer and tried two more times... I hope you'll resurface and let me know what you think about this. I go through the paces and the script is done in a millisecond and creates an empty morph I guess..... :-(

  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Got it working. What I THINK might be setting off the bug are two things

    1) Morph has to be active in order for it to mirror over
    2) Don't replace the suggested name from a copy and paste thing, just rewrite but not from scratch.

    I know, 2 very unlikely but can't think of anything else that I've done that perhaps I should not have....

    2 minutes at 30% so hopefully this is gold....

  • 3dOutlaw3dOutlaw Posts: 2,471

    3 cheers for this mirror-morph script.  Was searching for a method of doing this, works perfect!

    http://www.daz3d.com/forums/discussion/99751/create-a-right-and-left-morph-using-hex-for-daz-figure#latest

Sign In or Register to comment.