Sat, Jan 4, 4:25 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2025 Jan 03 1:41 pm)



Subject: ERC Question


Michael_C ( ) posted Fri, 23 July 2010 at 8:52 PM · edited Sat, 14 December 2024 at 12:52 PM

I am using the following ERC code in the xrot channel a Poser figure part:
     valueOpDeltaAdd
        Nordenfelt Gun-2B
        BODY:1
        ElevateGun
     deltaAddDelta -0.214

When the master dial is operated the body part rotates in the opposite direction at a fraction of the rate.

What I really want is for the body part to always rotate in the same direction, proportional to the master dial, regardless of the direction of movement of the master dial:

  • When the master dial is at zero, the slave part would be at zero.
  • When the master dial value INCREASES from zero, the slave part rotates say clockwise proportionally.
  • When the master dial value DECREASES from zero, the slave part rotates exactly the same way as when it INCREASES from zero.

Mathematically the deltaAddDelta parameter would be the absolute value of the master dial value times -0.214.

Is there away to do this? Thanks.

My Store - My Gallery - My Freebies - My Web Site


JoEtzold ( ) posted Fri, 23 July 2010 at 9:56 PM

With rotation if master and slave shall rotate the same amount you should set 1 as deltaAddDelta value. Rotation is everytime from 0 to 360 regardless of the diameter of the rotating parts.

With rotating everytime in the same direction regardless if the master goes positive or negative ... hm, not completely sure, but it should be possible. But it's rather tricky with additonal hidden dummy delta-dials.

You should have a look into the poser technical forum here at rendo. LesBentley has just written something about delayed ERC movements. This is the way to go even here.
And additional I have there named 2 links for additonal tutorial for this. In the tutorial at the second link you will find all information to solve your problem, I guess.


lesbentley ( ) posted Sat, 24 July 2010 at 12:17 AM

file_456483.TXT

The attached file is the text of a cr2, that I think does what you want. Use the "OneWay" dial in the Body to xRotate the cube. The set-up consists of 3 valueParm channels in the BODY, and two blocks of slaving code in the xRotate channel of the cube actor.

I have to go to bed now. I'll try to say more about how it works some time in the next 24 hours.


Michael_C ( ) posted Sat, 24 July 2010 at 9:23 AM

LesBentley and JoEtzold, thanks!

The dummy delta dials method was the solution.  I used the OneWay example and got my model working after just a few tries.  Most of the trouble I had was dealing with un-announced errors that caused Poser to ignore the new functions, and then I just needed to get my signs correct.  Great help.

I'll also check the referenced tutorials.

Thanks again.

My Store - My Gallery - My Freebies - My Web Site


lesbentley ( ) posted Sat, 24 July 2010 at 6:24 PM · edited Sat, 24 July 2010 at 6:32 PM

Glad you got it working Michael. I'll add a bit of explanation for others who may be following the thread. The "OneWay" channel in the BODY is the master channel that drives everything else, in this example it is a 'valueParm' channel, but it could be any type of channel:

        valueParm OneWay
            {
            name OneWay
            initValue 0
            hidden 0
            forceLimits 0
            min -100000
            max 100000
            trackingScale 0.100
            keys
                {
                static  0
                k  0  0
                }
            interpStyleLocked 0
            }

There is nothing special needed in this channel, it is just a normal valueParm channel. Two more valueParm channels "OneWay-A" and "OneWay-B" receive input from the master channel above. Here they are:

        valueParm OneWay-A
            {
            name OneWay-A
            initValue 0
            hidden 1
            forceLimits <span style="color:rgb(0,255,0);">1</span>
            min <span style="color:rgb(0,255,0);">0</span>
            max <span style="color:rgb(0,255,0);">100000</span>
            trackingScale 0.004
            keys
                {
                static  0
                k  0  0
                }
            interpStyleLocked 0
            valueOpDeltaAdd
                Figure 1
                BODY:1
                OneWay
            deltaAddDelta 1.000000
            }
        valueParm OneWay-B
            {
            name OneWay-B
            initValue 0
            hidden 1
            forceLimits <span style="color:rgb(0,255,0);">1</span>
            min <span style="color:rgb(0,255,0);">-100000</span>
            max <span style="color:rgb(0,255,0);">0</span>
            trackingScale 0.004
            keys
                {
                static  0
                k  0  0
                }
            interpStyleLocked 0
            valueOpDeltaAdd
                Figure 1
                BODY:1
                OneWay
            deltaAddDelta 0.000000
            }

The important thing to note, and the trick that makes the whole thing work, is the 'limits' on these two channels. The limits on "OneWay-A" have been set so that the channel can't go to a negative value, and the limits on "OneWay-B" are set so that it can't go to a positive value. This means that turning the "OneWay" master dial in a positive direction will affect OneWay-A, but will not affect OneWay-B because its limits prevent it from going positive. Conversely turning the master dial in the negative direction will affect OneWay-B, but can't affect OneWay-A. To complete the set up, we slave the xRotate channel to both OneWay-A and OneWay-B:

        rotateX xRotate
            {
            name xrot
            initValue 0
            hidden 0
            forceLimits 0
            min -100000
            max 100000
            trackingScale 1
            keys
                {
                static  0
                k  0  0
                }
            interpStyleLocked 0
            valueOpDeltaAdd
                Figure 1
                BODY:1
                OneWay-<span style="color:rgb(0,255,0);">A</span>
            deltaAddDelta <span style="color:rgb(0,255,0);">-0.214</span>
            valueOpDeltaAdd
                Figure 1
                BODY:1
                OneWay-<span style="color:rgb(0,255,0);">B</span> 
            deltaAddDelta <span style="color:rgb(0,255,0);">0.214</span>
            }

Note that one block of slaving code uses a negative deltaAddDelta value and the other uses a positive value. This ensures that the actor (cube) will rotate in the same direction irrespective of whether the master dial goes positive or negative. Swapping the sign in the 'deltaAddDelta'  lines of the two blocks of slaving code would make the actor rotate in the opposite sense.


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.