Forum: Poser - OFFICIAL


Subject: How to assign a Control Handle to more than one object?

Chanc opened this issue on Apr 11, 2020 ยท 40 posts


KarinaKiev posted Wed, 15 April 2020 at 2:49 PM

How to synch the eyes of a figure and add two extra bones to still control each eye individually at the same time


The goal of this tutorial is to achieve that both eyes can be rotated either with the mouse or with the up-down/side-side dials.

The former is rather straightforward and can be achieved with just 16 lines of additional code in the Figure's .cr2 file.

The latter requires more work, and you should have basic knowledge about the joint Editor.

But if even I could do it, then you can too!

LET'S GO!

Preparation:

It's quite easy to mess up in this process, >>> so create a new version of your original .cr2 file before progressing:

Now you have a "working copy" .cr2!

Tools needed:

(*1: Note that very large files can cause Notepad++ choke or even crash, and the basic Windows Notepad takes a long time to load and save a file. I suggest using "EditPad Lite". All these programs are free.

PART 1 - SYNCHRONIZING THE EYES:

Open the .cr2 file you have created earlier (the "working copy") in your text editor of choice. You'll see a lot of code, and it looks bloody confusing. But believe me, it isn't that bad, and most of it can be ignored.

This first part synchronizes the x-rotation dial (up/down) to it's twin in the left eye:

linkParms    rEye:1
xrot
lEye:1
xrot

But it needs to work the other way round too, so we need a linkback: (*2

linkParms    lEye:1
xrot
rEye:1
xrot

Now we repeat the same for the y-rotation (side-side):

linkParms    rEye:1
yrot
lEye:1
yrot

Again, the other way round too, here's the linkback: (*2

linkParms    lEye:1
yrot
rEye:1
yrot

So the complete code you need to copy/paste is this:

linkParms    rEye:1
xrot
lEye:1
xrot
linkParms    lEye:1
xrot
rEye:1
xrot
linkParms    rEye:1
yrot
lEye:1
yrot
linkParms    lEye:1
yrot
rEye:1
yrot

Now copy this code and paste it right below the "display On" line! Don't bother about correct indentation, but for a nice look try to anyway

Save your figure back to the library, then give it a test run. Both eyes should now move synchronized. (if not, it's back to the drawing board because somewhere you made a mistake. it's easy to become lost in 2.2 million lines of code...)


IF this was all you needed, you can stop reading now. You have made yourself a new base figure with easy-to-control, synchronized eyes.

I hope this was helpful. If you have any questions, please don't hesitate to ask.

K

footnote (*2: DO never try to achieve this by using ERC or dependent parameters instead of the "linkParms" code! Trying so will create an infinite program loop. But at least it's a sure way to terminate Poser and make it crash to the desktop...

XD