Sat, Nov 9, 6:14 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 08 10:28 pm)



Subject: Adding IK Chains via an Injection Pose?


WandW ( ) posted Wed, 16 January 2013 at 9:54 AM · edited Thu, 19 September 2024 at 7:40 AM

I've been playing with IK in Genesis using the DSON importer and it seems to work. 

I was wondering if it could be injected, rather than having to set it up manually and resaving?

I tried making an injection pose using the code from the saved cr2, but it doesn't work; the chains show up in the Hierarchy Editor, but they are empty.  Using only the naked inkyChain sections crashes Poser.  Is it even possible?

{

version
    {
    number 8
    }
figure
    {
    
        addChild    __SUBD:1
    BODY:1
    inkyChain     Left Leg  
        {
        off
        name Left Leg
        addLink lThigh:1
        addLink lShin:1
        goal lFoot:1
        linkWeight 0 1
        linkWeight 1 0.2
        }
    inkyChain     Right Leg  
        {
        off
        name Right Leg
        addLink rThigh:1
        addLink rShin:1
        goal rFoot:1
        linkWeight 0 1
        linkWeight 1 0.2
                }
          }
}

 

----------------------------------------------------------------------------------------

The Wisdom of bagginsbill:

"Oh - the manual says that? I have never read the manual - this must be why."
“I could buy better software, but then I'd have to be an artist and what's the point of that?"
"The [R'osity Forum Search] 'Default' label should actually say 'Don't Find What I'm Looking For'".
bagginsbill's Free Stuff... https://web.archive.org/web/20201010171535/https://sites.google.com/site/bagginsbill/Home


lesbentley ( ) posted Wed, 16 January 2013 at 1:46 PM

I think you need to 'declare' the actors that are parts of the IK chain. The code below seems to work, though I only did a very quick test, and can't guarantee it is free from problems. Also note that I left the 'figure number' out of the code. I don't know if that is necessary (probably not), but it seemed like a good idea, and shouldn't do any harm.

{

version
    {
    number 4.03
    }

actor chest
    {
 
    }
actor neck
    {

    }
actor head
    {

    }

figure
    {
    inkyChain     Head  
        {
        off
        name head
        addLink chest
        addLink neck
        goal head
        linkWeight 0 1
        linkWeight 1 0.2
        }
    }
}


WandW ( ) posted Wed, 16 January 2013 at 3:21 PM

This injects it perfectly, but when I tick the box it doesn't work!  I'm comparing the Genesis cr2 with and without IK to see if there are any other differences; it's a 40MB cr2, so it takes some time...

 

{

version
    {
    number 8
    }
    
    actor lThigh
    {
 
    }
    actor lShin
    {
 
    }
    actor lFoot
    {
 
    }
    actor rThigh
    {
 
    }
    actor rShin
    {
 
    }
    actor rFoot
    {
 
    }
    
    figure
    {
    inkyChain     Left Leg  
        {
        off
        name Left Leg
        addLink lThigh
        addLink lShin
        goal lFoot
        linkWeight 0 1
        linkWeight 1 0.2
        }
    inkyChain     Right Leg  
        {
        off
        name Right Leg
        addLink rThigh
        addLink rShin
        goal rFoot
        linkWeight 0 1
        linkWeight 1 0.2
                }
     }
}

----------------------------------------------------------------------------------------

The Wisdom of bagginsbill:

"Oh - the manual says that? I have never read the manual - this must be why."
“I could buy better software, but then I'd have to be an artist and what's the point of that?"
"The [R'osity Forum Search] 'Default' label should actually say 'Don't Find What I'm Looking For'".
bagginsbill's Free Stuff... https://web.archive.org/web/20201010171535/https://sites.google.com/site/bagginsbill/Home


lesbentley ( ) posted Wed, 16 January 2013 at 3:35 PM · edited Wed, 16 January 2013 at 3:43 PM

I have had another look at this IK injection stuff, and decided that the code I gave in my last post, needs some modification.

If you look in the lFoot actor of figures that have IK chains for the legs, you will see two extra lines that do not exist in most actors:

    inkyParent BODY
    nonInkyParent lShin

The 'inkyParent' is the actor that will be the parent when the IK chain is turned on. Normally this will be BODY, but of course you can change the parent whilst IK is turned on. If you do change the parent, Poser will update the inkyParent line with the new parent.

You should be able to guess the purpose of the nonInkyParent line. When IK is turned off, Poser changes the parent of the IK goal actor to be the actor in the nonInkyParent line. Whilst the inkyParent can change, the nonInkyParent always stays the same (the normal parent).

Now the relevance of all this to IK injection is that whilst Poser will ues these extra lines if they are there, it does not automatically add them. You need include them in the injection pz2. If you do not:

a). Poser will not automatically change the parent to the inkyParent (to BODY) when you turn on IK.

b). If you change the parent whilst the IK is on, when you turn IK off, Poser won't restore the normal parenting.

So, my new code for IK injection is this:

{

version
    {
    number 4.03
    }

actor BODY
    {

    }
actor chest
    {

    }
actor neck
    {

    }
actor head
    {
    inkyParent BODY
    nonInkyParent neck
    }

figure
    {
    inkyChain     Head  
        {
        off
        name head
        addLink chest
        addLink neck
        goal head
        linkWeight 0 1
        linkWeight 1 0.2
        }
    }
}

Because the new code refers to the BODY actor, I have added a declaration for BODY. Again, I'm not sure if that was necessary, but it seemed like a good idea.


WandW ( ) posted Wed, 16 January 2013 at 3:46 PM · edited Wed, 16 January 2013 at 3:49 PM

Yep, that's what I found by running a diff on the files; it works! :biggrin:

The declaration for BODY is indeed necessary, as I discovered.  😄

Here's the final version; Many Thanx! 

{

version
    {
    number 8
    }
    

    actor BODY
    {
 
    }
    actor lThigh
    {
 
    }
    actor lShin
    {
 
    }
    actor lFoot
        {
     inkyParent BODY
    nonInkyParent lShin
        }
    actor rThigh
    {
 
    }
    actor rShin
    {
 
    }
    actor rFoot
        {
    inkyParent BODY
    nonInkyParent rShin
        }
    
    figure
    {
    inkyChain     Left Leg  
        {
        off
        name Left Leg
        addLink lThigh
        addLink lShin
        goal lFoot
        linkWeight 0 1
        linkWeight 1 0.2
        }
    inkyChain     Right Leg  
        {
        off
        name Right Leg
        addLink rThigh
        addLink rShin
        goal rFoot
        linkWeight 0 1
        linkWeight 1 0.2
                }
     }
}

 

----------------------------------------------------------------------------------------

The Wisdom of bagginsbill:

"Oh - the manual says that? I have never read the manual - this must be why."
“I could buy better software, but then I'd have to be an artist and what's the point of that?"
"The [R'osity Forum Search] 'Default' label should actually say 'Don't Find What I'm Looking For'".
bagginsbill's Free Stuff... https://web.archive.org/web/20201010171535/https://sites.google.com/site/bagginsbill/Home


lesbentley ( ) posted Wed, 16 January 2013 at 3:54 PM

Glad you got it working.

😄


WandW ( ) posted Wed, 16 January 2013 at 8:19 PM · edited Wed, 16 January 2013 at 8:23 PM

There is a small fly in the ointment; the x, y and z translate dials are set to force limits on the feet, so they have to be unchecked to move the feet with IK on.  I take it that those are the normal translation paramaters for that part?   

It's kind of ugly wading through those weight maps in Wordpad. PZ3Editor dies on this one; I'll give old version 1.0 a try...

----------------------------------------------------------------------------------------

The Wisdom of bagginsbill:

"Oh - the manual says that? I have never read the manual - this must be why."
“I could buy better software, but then I'd have to be an artist and what's the point of that?"
"The [R'osity Forum Search] 'Default' label should actually say 'Don't Find What I'm Looking For'".
bagginsbill's Free Stuff... https://web.archive.org/web/20201010171535/https://sites.google.com/site/bagginsbill/Home


WandW ( ) posted Wed, 16 January 2013 at 9:08 PM · edited Wed, 16 January 2013 at 9:16 PM

Good old PZ3edit 1.0 didn't choke, and I found the translations under channels amidst the weightmaps and morphs (the cr2 is over 1.16 ***million ***lines; it's BIG!), set Force Limits to 0 and it's good... I think.  😄

----------------------------------------------------------------------------------------

The Wisdom of bagginsbill:

"Oh - the manual says that? I have never read the manual - this must be why."
“I could buy better software, but then I'd have to be an artist and what's the point of that?"
"The [R'osity Forum Search] 'Default' label should actually say 'Don't Find What I'm Looking For'".
bagginsbill's Free Stuff... https://web.archive.org/web/20201010171535/https://sites.google.com/site/bagginsbill/Home


lesbentley ( ) posted Thu, 17 January 2013 at 11:52 AM · edited Thu, 17 January 2013 at 11:58 AM

Quote - There is a small fly in the ointment; the x, y and z translate dials are set to force limits on the feet, so they have to be unchecked to move the feet with IK on.  I take it that those are the normal translation parameters for that part?

   

I don't think it's normal to force limits on any translation channels in a human figure. I can't think of any reason why they would want to do that. I know for a fact that the following figures do not have limits forced on foot translations, and that even if they did, the min and max are set so high that it would make no practical difference.

Posette
Jessi
Antonia 1.2
SydneyG2

Plus I don't remember seeing forced translation limits in V3 or V4, though I can't be absolutely sure they weren't there.

You should be able to un-force the limits with the same pz2 you use to inject the IK: actor lFoot
    {
    inkyParent BODY
    nonInkyParent lShin
    channels
        {
        translateX xtran
            {
            forceLimits 0
            }
        translateY ytran
            {
            forceLimits 0
            }
        translateZ ztran
            {
            forceLimits 0
            }
        }
    }

I can't see that doing that could do any harm, unless there is something special about Genesis that requires it (which I doubt).

Quote - It's kind of ugly wading through those weight maps in Wordpad. PZ3Editor dies on this one; I'll give old version 1.0 a try...

If I need to test a parameter change, I find it is often as easy to write a pose file to change it, as it is to edit the cr2, and you can save the pz2 for future use. For example to un-force translation limits in an actor you can use this:

{

ForceTran0.pz2

version
    {
    number 5
    }

    actor $CURRENT
    {
    channels
        {
        translateX xtran
            {
            forceLimits 0
            }
        translateY ytran
            {
            forceLimits 0
            }
        translateZ ztran
            {
            forceLimits 0
            }
        }
    }
}

The "$CURRENT" tells Poser to apply the pose to the currently selected actor. "$CURRENT" can be useful for a lot of things, and especially where the Poser interface does not provide a means to change a parameter. Speaking of which, P9 does allow you to toggle force limits via the 'Edit Parameter Dial' box that you get if you double click on a dial.   


WandW ( ) posted Thu, 17 January 2013 at 12:10 PM · edited Thu, 17 January 2013 at 12:16 PM

I'm fishing around inside the cr2 because I don't quite know what I'm doing.  😄

I was able to incorporate it into the same IK pose.  I wish there were a way to stick a bit of geometry to the hip actor so I could select and drag it; it's not hidden, but  there's stuff like this in there...

 valueParm DSON_DEFINITION_ID
            {
            name %2Fdata%2FDAZ%25203D%2FGenesis%2FBase%2FGenesis.dsf%23hip
            initValue 0
            hidden 1
            enabled 1
            forceLimits 0
            min -100000
            max 100000
            trackingScale 0.01
            keys
                {
                static  0
                k  0  0
                }
            interpStyleLocked 0
            }

I didn't know about $CURRENT, so that's a valuable piece of info.

Thanx, Les!

----------------------------------------------------------------------------------------

The Wisdom of bagginsbill:

"Oh - the manual says that? I have never read the manual - this must be why."
“I could buy better software, but then I'd have to be an artist and what's the point of that?"
"The [R'osity Forum Search] 'Default' label should actually say 'Don't Find What I'm Looking For'".
bagginsbill's Free Stuff... https://web.archive.org/web/20201010171535/https://sites.google.com/site/bagginsbill/Home


lesbentley ( ) posted Thu, 17 January 2013 at 1:33 PM · edited Thu, 17 January 2013 at 1:36 PM

I don't have Genesis, and don't know anything about how DSON works.

Quote - I wish there were a way to stick a bit of geometry to the hip actor so I could select it.

Why can't you select it? If the hip is not 'hidden', you should be able to select it from the drop-down body parts list. Even if it is hidden, you should be able to select it (and bring up its parameters) by selecting it in the hierarchy editor.

You may be able to stick some geometry into the hip, if you need to. A pose file can inject geometry into an actor, eg:

{

box_hip.pz2

version
    {
    number 3
    }

actor hip
    {
    storageOffset 0 0.3487 0
    objFileGeom 0 0 :Runtime:Geometries:props:box.obj
    }
}

However there could be some problems. In a normal figure, in the 'figure' section, the hip is set to weld to the abdomen, and the thighs (or buttocks) are set to weld to the hip. If you inject foreign geometry into the hip, those weld statements are still in place, and can cause ugly results when those parts try to weld to mesh they were never meant to weld to.

Now I don't know how this would play out in Genesis. It sounds from what you said that the hip is only a ghost actor in Genesis (otherwise you wouldn't need to "stick a bit of geometry" to it). In which case it might not have any weld statements, so no problem. Anyway, it's probably worth a try. Note that the box will load at its normal location, not where the hip is. You may want to make your own geometry, one that loads in a more appropriate place.


WandW ( ) posted Thu, 17 January 2013 at 2:29 PM

I looked in the cr2 and the hip actor isn't welded to anything.

Your script puts the box on the floor, which makes sense in a way, because in spite of the offset, the hip actor itself is in its zeroed position.  I imported a box primitive, raised it to the middle of the pelvis and scaled it down and exported it as lilbox.obj, changing the pose reference, and it shows up inside the pelvis and can be found and dragged about with the mouse.

This has been a very educational project.  You are a fine teacher.  😄

----------------------------------------------------------------------------------------

The Wisdom of bagginsbill:

"Oh - the manual says that? I have never read the manual - this must be why."
“I could buy better software, but then I'd have to be an artist and what's the point of that?"
"The [R'osity Forum Search] 'Default' label should actually say 'Don't Find What I'm Looking For'".
bagginsbill's Free Stuff... https://web.archive.org/web/20201010171535/https://sites.google.com/site/bagginsbill/Home


WandW ( ) posted Mon, 28 January 2013 at 3:38 PM

I put the Poses to add IK and the Hip Handle to Genesis together and posted it as a freebie....

http://www.sharecg.com/v/67133/view/11/Poser/Inverse-Kinematics-for-DAZ-Genesis-in-Poser

 

Thanx again, Les!  😄

----------------------------------------------------------------------------------------

The Wisdom of bagginsbill:

"Oh - the manual says that? I have never read the manual - this must be why."
“I could buy better software, but then I'd have to be an artist and what's the point of that?"
"The [R'osity Forum Search] 'Default' label should actually say 'Don't Find What I'm Looking For'".
bagginsbill's Free Stuff... https://web.archive.org/web/20201010171535/https://sites.google.com/site/bagginsbill/Home


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.