Mon, Dec 23, 12:24 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Dec 23 8:11 am)



Subject: A Compendium of PZ2 Techniques.


MartinW ( ) posted Thu, 10 April 2008 at 2:46 AM

bkmk


mada ( ) posted Thu, 10 April 2008 at 4:10 AM

...

...faith, trust and pixiedust


byAnton ( ) posted Thu, 10 April 2008 at 9:21 PM

Then there are adding and removing custom materials via a pose too.

-Anton, creator of Apollo Maximus
"Conviction without truth is denial; Denial in the face of truth is concealment."


Over 100,000 Downloads....


lesbentley ( ) posted Fri, 11 April 2008 at 10:30 PM

file_403984.jpg

**Delta Injection (Part 4).****Delta Injection in conjunction with FBMs.**

First a short disclaimer. I have never distributed delta injection poses commercially. What follows is to the best of my knowledge and understanding, correct, but there may be errors, and there probably are better ways of doing things. I include the following because I have not seen much information out there on delta injection, and I hope this may be useful, but I am only a hobbyist, I am no authority on this stuff.

A Poser Full Body Morph (FBM for short) is just one or more targetGeom (morph) channels slaved to a valueParm channel (usually) in the BODY actor.

If you have a figure that uses the DAZ "PBMCC_##" channels, then svdl has a Python script "SpawnCharacterP6.py" that makes much of what is described below redundant for these figures. I will try to say more about this script later, or perhaps svdl will drop by and explain it himself. Never the less, I urge you to investigate these hand editing methods as you will gain a better understanding. Also because these methods can be used on figures that the py script may not work on.

We have seen how to package a morph target in order to inject it into a figure from a pose file. And in a previous section we saw how to slave one channel to another. We already know what must be done. Now we will look as some of the many ways of doing it.


**Method A.**The first scenario. You have a number of custom made morph targets in obj format, one for each of several actors. Or you are making morphs in Poser with magnets. You want to inject these as an FBM into one of the DAZ figures that use the PBMCC_## channels.

Many of the DAZ Figures come with a "BLANK" version that has been stripped of all targetGeom channels, or all targetGeom channels EXCEPT the JCM (joint controlled morph) channels. These figures are good to use when making a DIP for custom morphs that you have made yourself, and that you want to distribute, as they reduce the risk of including any data that may be subject to copyright such as DAZ morph deltas. You don't have to use a BLANK figure this method will work on the normal figure as well.

As you import a morph from an obj file, or spawn it from a magnet, or what ever method you use to get the morph into the figure, give it a descriptive name. In this example we'll use "MyMorph" as an example. As you are only putting one morph into each actor you should use the same name throughout for all the morphs. As you load each morph, set its dial value to "1.000".

Once you have all your morphs in the figure and the dials set to one, from the Figure menu, select "Create Full Body Morph", give it the same name as you did for the individual morphs (MyMorph). Creating the FBM puts the slaving code into the targetGeom channels, as well as creating a valueParm channel in the BODY.

Save the figure back to a Figures pallet as "Z" (for example).

The next step is to create a template pz2 containing each actor that you need to inject into. You have already seen an example for one actor in a previous post. Here is a template for the BODY, collars, chest, abdomen and hip. The order that the actors come in, is not really important, but it will be easier if you keep them in the same order as in the cr2. Remember each actor should contain a 'channels' section. Because this is for an FBM you need to include the BODY actor.

{

version
    {
    number 4.01
    }

actor BODY
    {
    channels
        {

        }
    }
actor hip
    {
    channels
        {

        }
    }
actor abdomen
    {
    channels
        {

        }
    }
actor chest
    {
    channels
        {

        }
    }
actor rCollar
    {
    channels
        {

        }
    }
actor lCollar
    {
    channels
        {

        }
    }

figure
    {

    }
}

The next step is to copy the valueParm channel, and the targetGeom channels, out of the "Z.cr2" into the template. It is possible to do this in a text editor, but that can involve a lot of scrolling, I don't recommend it. There are a couple of free utilities that can be used. Either of these can do the job. CR2Builder
http://www.geocities.co.jp/Bookend-Ohgai/9483/tool/CR2Builder/index.html
Morph Manager 4
http://www.morphography.uk.vu/dlutility.html

I'm going to use CR2Builder in this example.

Open CR2Builder. Load the cr2 in the Left TV (window). Scroll down past the first set of actors (the "definition" blocks), these are single spaced, until you get to the second set, which should be double spaced.

Load the template pz2 in the Right TV. In the Right TV expand the BODY actor (click the "+"), expand the 'channels' block. Go to the Left TV and expand the BODY actor and channels block. Drag the "valueParm MyMorph" channel and drop it on the "stump" in the 'channels' block.

In the Right TV expand the next actor and channels block. Go to the Left TV and expand the corresponding actor and channels block. Drag your "targetGeom MyMorph" channel and drop it on the "stump" in the 'channels' block (see graphic above). Keep repeating this process until you have copied all the "targetGeom MyMorph" channels over to the template.

If you included any material settings in the "Z.cr2" you may want to copy these over to 'figure' section of the pz2 file, so that it loads the materials as well as the morphs. If this pz2 is for distribution, you will need to include any maps (eg texture maps) referred to in the materials, or warn the end user that certain maps are required. I do not have time to go into the full implications of including materials at this moment, if in doubt, don't.

Save the template with the final name that you desire, make it something descriptive, eg "V3_OldCrone.pz2", or "V3_Fat.pz2", or "V3_K Z Jones.pz2".

Next you need to open the pz2 you just produced in a text editor.

There will be colons and numbers ":#" in the slaving code, you need to remove these, otherwise the channels may get slaved to the wrong figure (as sometimes happens with DAZ injections). Use your editors Search & replace function to replace all instances of ":1" (or whatever number was used) with nothing, that is to say leave the Replace string blank. Now Search & Replace "Figure 1" with "Figure".

Go to the "valueParm MyMorph" channel in the BODY and change its first line to one of the DAZ PBMCC_## names, eg "valueParm PBMCC_01". Now use your editors Search & Replace function to replace all instances of "targetGeom MyMorph" with the same PBMCC_## you used in the valueParm, eg replace "targetGeom MyMorph" with "targetGeom PBMCC_01".

To make the FBM you needed to set all the morph channels to a value of one, now you need to set them back to zero. Search & Replace "k 0 1" with "k 0 0".

At the moment the valueParm channel is set to zero, so the morphs will load but not be expressed, if you want them to be expressed when you apply the pz2, go to the BODY and set the channel to "k 0 1". You may or may not want to set the 'initValue' of this channel to "1". The 'initValue' is the value that will be used when one of the Poser 'Restore' commands is used on the figure.

Save the file back to disk and test it in Poser. Once you have verified that the DIP is working properly, you can delete the "Z.cr2".

To be continued...


Cage ( ) posted Fri, 11 April 2008 at 11:22 PM

This is a great thread!  :D  :D

A .cr2 can be loaded as a pose.  I've done that before, to try to correct a hand-editing error in a .cr2, by loading an older version on top of the edited one.  I'm not saying it worked well... only that it can be done.  Cough.

Don't forget about the geometry insertion poses!  Heh.

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


lesbentley ( ) posted Sat, 12 April 2008 at 12:05 AM

Hi Cage,

I plan to cover geometry injection at some stage, but I still have a few things to say about delta injection first. Then there is 'readScript', which seems like it might slot in well after delta injection.


geralday ( ) posted Sat, 12 April 2008 at 4:20 AM

Thanks Les, Main Camera Fill Light... I'm using this right now! Very useful. No matter how long you've been using Poser there's still good stuff to learn. Gerald.


lesbentley ( ) posted Sun, 13 April 2008 at 5:24 PM

**Delta Injection (Part 5).**Morph Manager 4

Method B.

This is very similar to Method A, it produces exactly the same results, except it uses "Morph Manager 4" (MM4), to do it, and some of the steps are different. Actually the results are not "exactly" the same, MM4 replaces tab stops with spaces, so the file will be larger.

Proceed with creating and saving the "Z.cr2" as in Delta Injection (Part 4), Method A. Also construct a template as in Method A. Open MM4. Load the template pz2 into BOTH windows (this will force MM4 to to give you some different options and features). Note that for the previous step you need to have "Pose Files (*.pz2)" selected in the "File Types:" box of the Open dialogue box.

Now load "Z.cr2" into the left window. From the 'More Options' button, select 'Zero all morph targets in file'. In the left window, expand the BODY, Left Click on "MyMorph" (or what ever your morph is called), and select 'Copy'. Collapse the BODY, and go to the next actor you need to copy from, expand it, Left click on "MyMorph" and select 'Copy'. Repeat the procedure for for all actors that contain "MyMorph". Save the pz2 with its final name.

Close MM4. Open the pz2 in a text editor and proceed with the text edits as in Method A, except there is no need to zero the channels, this was already done in MM4.


I have just gone through this process, and notice that it I was able to do it quite a bit faster in MM4, than in CR2Builder. However CR2Builder is much more flexible for general Poser library file editing. Also CR2Builder has some special features built in for handling ERC. I have never learnt how to use those features, so I am probably not using CR2Builder in the most efficient way. Another factor in MM4 is that in its windows it lists the actors in alphabetical order. MM4 is also good if you want to create a morph-stripped "BLANK" cr2. Load a pz2, any pz2, into the left window, then load your cr2 into the SAME window. From the 'More Options' button select 'Delete all morph targets from file. You will then have to expand the BODY and delete any valueParm channels one at a time, but the bulk of the work has been done for you in deleting the targetGeom channels.

To be continued...


lesbentley ( ) posted Mon, 14 April 2008 at 4:37 PM · edited Mon, 14 April 2008 at 4:46 PM

**Delta Injection (Part 6).**Delta Injection in conjunction with FBMs, continued.

An FBM DIP for figures that do not have channels set-aside for third party injections.

Even with figures that were not designed to take third party injections, you may still be able to do this.

With some figures delta injection is easy because of they have extra channels included in the cr2 for this purpose. Many of the earlier figures do not.

As stated earlier a channel must exist in the figure before you can inject anything into it. In P6 or above, 'createFullBodyMorph' can be used to create new valueParm channels, and PMD files can import new targetGeom channels. See the tutorial by Nerd for more info on 'createFullBodyMorph' and PMD. Remember that the end user must have P6.
http://www.nerd3d.com/modules.php?name=Content&pa=showpage&pid=13

What follows are methods that can be used in P4 or above. The P4 Nude Man and Woman have one valueParm channel in the BODY that controls the SuperHero FBM. There are targetGeom channels in many (but not all) actors, these are slaved to the SuperHero FBM. Obviously if we have custom morphs we can inject them into these channels. It may be that we do not want to inject morphs into all the actors that are slaved to the SuperHero valueParm. In that case we can REMove the deltas from some channels by using "indexes 0", eg:

actor lShin
        {
        channels
                {
                targetGeom heroLShn
                        {
                        indexes 0
                        }
                }
        }
actor rShin
        {
        channels
                {
                targetGeom heroineRS
                        {
                        indexes 0
                        }
                }
        }

These channel names are from the P4 Nude Woman, note the inconsistent naming of the channels "heroLShn" and "heroineRS". It would have been more rational to use "SuperHero" throughout. Even if a figure has no valueParm channel it may be possible to implement an FBM by slaving channels to some targetGeom channel, but remember that in versions prior to P6, a master channel should be no more than one step below any of its slaves in the Hierarchy, or the slaving may not work properly. For example a master channel in the chest could control morphs (or other channels) in the eyes and fingers, and any parts in-between, but could not be used for slaves in the hip or legs. P6 seems like it has solved this problem, and it now seems that the master channel can reside anywhere, though I have not tested this thoroughly. Perhaps this new functionality in P6 is related to the implementation of Auto Balance.

If all else fails there is one last pz2 P4 compatible method we can try to put some new channels into the figure. It involves the use of readScript. It's not a very good method because it relies on knowing the location of the cr2 that we want to inject into. Many people organise their library folders, moving cr2 files from their default location, this can defeat our method. Never the less I include it for the sake of completeness. Note that the file below is, and must be a CR2.

The idea is that we have a small cr2 that contains the channels we want to add. A 'readScript' then loads the cr2 that we want to add channels to, and integrates it in Poser into one figure. In this case we MUST use an actor number for the actors themselves, but not for the slaving code. There must NOT be a 'figure' section in this file.

{
//AddChans.CR2
//Use ":1" for actors, but not for slaving, and don't include a 'figure' block.
version
        {
        number 4.01
        }
//Edit the line below to reflect the location of your cr2.

readScript ":Runtime:libraries:Character:LES CR2:P4Woman.cr2"

actor BODY:1
        {
        channels
                {
                valueParm Morph_01
                        {
                        name Morph_01
                        hidden 0
                        }
                }
        }
actor head:1
        {
        channels
                {
                targetGeom Morph_01
                        {
                        name Morph_01
                        hidden 0
                        valueOpDeltaAdd
                                Figure
                                BODY
                                Morph_01
                        deltaAddDelta 1.000000
                        indexes 1
                        numbDeltas 3470
                        deltas 
                                { 
                                d 1514 -5.277533e-006 -0.001445413 0.03142137 
                                } 
                        }
                }
        }
# Don't include a 'figure' block.
}

NOTES:
This is just an example, the above file is to put a point on the nose of the P4 Nude Woman. Replace the 'indexes', and 'numbDeltas' lines, and the deltas themselves with your own, or just leave these lines out. I have not tested this file outside of P6. I can't guarantee that it will work in other versions, but I am hopeful that it will.

In P4 there should be no other figures in the scene when you load this file (in P7, P6, and P5, it should not matter), and if the actor number (:#) in the cr2 which is loaded via readScript is NOT ":1" the slaving will probably not work. You may run into other problems in P4, as P4 ERC suffers from a problem called "crosstalk".


Although that was my last ditch method for adding channels via a poser file, if you only wont to do this for your own use, there is nothing to stop you text editing the cr2 to add the necessary channels. But that's not much use if you need to distribute the poses. If you do want to add channels to a cr2, and you have a text editor that can do multiple line Search & Replace (eg "EditPad Lite"), then there is an easy way to add some channels to every actor in a cr2. Use this as the search string, it needs to include the leading blank space, best to copy the lines directly from your cr2, because the indentation must match exactly.

        channels
                {

The replace string starts with the two lines above, then includes the channels you want to add. The indentation is not critical in the replace string. channels { targetGeom Morph_01 { name Morph_01 } targetGeom Morph_02 { name Morph_02 } targetGeom Morph_03 { name Morph_03 }

I have used "Morph_##" above, but of course you can use "PBMCC_##" or anything you like. - - - - - -

To be continued...


lesbentley ( ) posted Mon, 14 April 2008 at 10:53 PM · edited Mon, 14 April 2008 at 11:01 PM

**Delta Injection (Part 7).**The Easy Way!

SpawnCharacterP6.py & Pozers Little Helper.

Now that I have put you through hell for the last 6 posts, I am going to tell you about a couple of easy ways to do it.

For the first way you will need P6 or later to produce the files, the files you produce should work from at least P4 up. The method is simply to use svdl's "SpawnCharacterP6.py", available from svdl's Free Stuff, or the thread link below.

http://www.renderosity.com/mod/forumpro/showthread.php?thread_id=2632044&page=1

It can be used to create delta injection files from from your own custom morphs. It produces both INJection and REMoval files. The script automatically excludes any JCM morphs, and there is a switch (on by default) to exclude facial expression morphs. I have used it a few times on V3 SAE and V3 RR, I am very impressed with this script. The interface is simple and self explanatory, one thing to watch is that you use the "Create" before the "OK" button, or you will have to start again.

The only real down-side I have found is that it only works on the DAZ figures with PBMCC_## channels. Svdl is currently working on a successor to SpawnCharacterP6 that will work for all figures. It will be able to create separate head and body INJ and REM files, it will also be able to incorporate magnets. Progress is slow due to his many other commitments.

The code produced by "SpawnCharacterP6.py" is well formed, and does not contain actor or figure numbers, so the injections can be used on any figure in the scene. If you have P6 or above, and are using the DAZ figures, then I feel I can highly recommend this script as a way of producing your delta injections.


Another way to produce DIPs is with "Pozers Little Helper" (PLH). PLH is free a stand alone application, the files it produces should work on any version of Poser from at least P4 up. PLH works by comparing the base obj of the figure with a morphed version of the same obj file, that you must supply your self. PLH is particularly suited to those who want to take the whole base obj of a figure into a modelling application to morph it, but you can also export a morphed poser figure to use in PLH, or import the base obj into Poser, morph it with magnets, then export it as a new morph. There is a bit of work to do in setting up PLH for the first time, and its not the most intuitive thing I have ever used, but once you get the hang of it your files can be produced quickly and easily. The code is not as well formed as that produced by svdl's script, but it does do the job. PLH includes Figure and actor numbers in the code, so you may want to edit these out. If you want to export a full body obj from Poser to use in PLH, you should use "Include existing groups in polygon groups" and "As Morph Target", no other options (and P6-7 users, remember to exclude the "GoalCenterOfMass" and "CenterOfMass" props). The good points of PLH are that it is not dependant on any particular Poser version, and it can be used to produce DIP files for any figure that has channels to be injected into (with a little bit of setting up). Download PLH from the link below, there are also a couple of files that PLH needs to work, these can also be found at the linked site.

http://home.online.no/~kjellil/Index-AllStuff.htm


SUMMATION:
SpawnCharacterP6.py is quick and simple to use. Can only be run in P6 or up, but files produced work in any version. Only works for figures that have PBMCC_##.

PLH only works on PC, not tied to poser version. Works on full body obj. Not as quick or simple as SpawnCharacterP6, but can be configured to work on any figure. - - - - - -

To be continued...


shedofjoy ( ) posted Tue, 15 April 2008 at 9:17 AM

Awesome thread....BOOKMARKED

Getting old and still making "art" without soiling myself, now that's success.


lesbentley ( ) posted Tue, 15 April 2008 at 1:31 PM · edited Tue, 15 April 2008 at 1:44 PM

**The Monster Eyes Problem (part 1).**Sometimes when you morph the head the eye sockets get moved, and the eyes need to be moved and/or scaled to fit the new location of the eye sockets. If you try to move an eye by a positioning morph, not only will you waste disk space, but more importantly the eye geometry will be moved away from its 'origin' (centre of rotation). The eye will no longer rotate properly and will tend to move out of the eye socket when rotated. On the other hand, if you use a normal pose file to directly reset the translations of the eye (or set the translations via the dials), then the first time a stock pose is applied to the figure, it is likely to reset the translations of the eye back to zero.

I call this "The Monster Eyes Problem", because this situation often occurs when you create a monster or alien head morph.

The best solution to this problem is to slave the translations (and if necessary scale) of the eye to the the head morph. Let's do this as an exercise.

Load a figure, select the head, then create a magnet. Scale the magnet up to 135%. Spawn a morph for the head, let's call it "Monster". Delete the magnet and set the morph dial to 1.000. Translate the right eye until it fits the socket. Increments of the Tran dials may be too coarse to get exact placement, you may need to click on a dial then type in the number, this gives you 6 decimal places. If the head morph is symmetrical you can Copy the right eye (Ctrl+C), and Paste the values into the left eye (Ctrl+V), then reverse the sign for xTran in the left eye (delete the "-"). Rotate the eyes to check that the placement is OK when rotated.

Select the leftEye, do Ctrl+C (Copy), open Notepad (or some other text editor), do Ctrl+V (paste), enter a carriage return, then do the same for the rightEye, Pasting its data in Notepad under that for the leftEye.

Make a DIP for the "Monster" head morph by any method. Add actors with 'channels' blocks for the leftEye and rightEye to the DIP, it does not matter whether they go before or after the other actors.

You only need channels for for the values that need to be changed, eg if you do not need to yTran the eyes to fit the morphed head, leave the 'ytran' out.

Now add slaving code to each of these channels to slave them to the "Monster" targetGeom channel in the head:

actor leftEye
        {
        channels
                {
                translateX xtran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                translateY ytran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                translateZ ztran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                }
        }
actor rightEye
        {
        channels
                {
                translateX xtran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                translateY ytran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                translateZ ztran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                }
        }

The code you added should look like above, the deltaAddDelta values (in red above) will need to be specific to your morph. For the 'deltaAddDelta' use the value for 'xtran'  you stored in Notepad. Repeat the process for 'ytran' and 'ztran', using the corresponding values from Notepad for the 'deltaAddDelta' values. Now repeat the process for the rightEye. Save the file back to disk and test it. NOTES:
The eyes should be slaved to the dial name of the targetGeom channel, in preference to its internal name, so that if a new head morph with a different dial name is injected into the same channel the slaving will be broken.

The translate channels should be slaved directly to the morph in the head, they will still work if the head morph is activated via a master channel in the BODY, or some other place.

In my next post I will say a bit about scaling the eyes.

To be continued...


vincebagna ( ) posted Tue, 15 April 2008 at 1:58 PM · edited Tue, 15 April 2008 at 1:59 PM

uh oh! The one i was waiting for! ^^

I have to thank you again for all the work you put to share your knowledge and to make ours bigger! :D

My Store



lesbentley ( ) posted Thu, 17 April 2008 at 2:36 PM · edited Thu, 17 April 2008 at 2:46 PM

**The Monster Eyes Problem (part 2).**Scaling the Eyes.

Please bare in mind that what follows is from a few experiments I have done at home on my PC, I have not "road tested" any of this. There may be mistakes, bugs, consequences that I am not aware of, or important things that I have forgotten to say. If you plan to distribute anything based on the methods below, do your own testing first to verify that it works as expected under all conditions. If you find any mistakes, or know of different or better methods, please let us know.


You might expect (quite reasonably) that slaving the scale channel of an eye to a morph in the head would work just the same as slaving a translation. The situation is not always that simple, a number of new factors come into play. Take "Victoria 3 SAE" (or V3 RR) as an example, try scaling both her eyes up to 300%. They end up different sizes!!! This is because the 'smoothScaleY head_smooY' joint parameter channels in the eyes use different settings for the 'smoothZones' in each eye. Phew, bet you didn't now that! This introduces one of the problems that we can face in scaling the eyes, 'smoothScale' channels in the eyes, or head, can affect the results of our attempts to scale the eyes. And when each eye can scale differently in response to the same input we have a real mess, but this is just the start of the complications. Now try scaling V3's head. Again the eyes end up different sizes, and whilst the eyes scale up with the head to some extent, they do not scale to the same extent as the head, leaving them relatively smaller. If you try to scale the eyes of the P4 Nude Woman, or Jessi, they won't scale at all! Again this problem is caused by the 'smoothScale' channels, but in a slightly different way. In fact most of the problems I have seen with scaling the eyes relate to the 'smoothScale' channels.


Determining the value for the 'deltaAddDelta'.
You should select the method you are going to use before you determine the value for the 'deltaAddDelta', if the DIP is ging to scale the head as well as the eyes, you should do that first, also if the method calls for turning 'bend' off, or changing the value in 'smoothScaleY' these things should be done before you determine the value. You should understand this paragraph better when you have finished reading this post.

You can determine the correct value for the 'deltaAddDelta' of the scale channel in similar way what you did for the translations, but there is an extra step. Apply the head morph at a value of "1.000", scale the eye to the size you desire, then Copy the eye and Paste into Notepad. Now instead of using the number straight from Notepad, delete one from the number. Eg if the number from Notepad is "2.480" use "1.480", or if the number from Notepad is "1.332" use "0.332", if the or if the number from Notepad is "0.500" use "-0.500".

Although I have put scaling into a separate post, in practice you should probably be determining the values for scale and translation at the same time, so that you can see the combined effect of both.


**Method A.**If the scale dial in the eyes works to scale them, then you should probably use this method. If the eyes do not respond to the scale dial, you will have to use one of the other methods.

This is the same as we did for the translations, except with "1" subtracted from the 'deltaAddDelta' value. Here is an example of the code you would add to your DIP.

actor leftEye
    {
    channels
        {
        scale scale
            {
            valueOpDeltaAdd
                Figure
                head
                NameOfHeadMorph
            deltaAddDelta 
            }
        }
    }

**Method B.**If the eyes won't scale in response to the scale dial when 'bend' is on, one approach we can take is to turn 'bend' off (bend 0) for the eye actors. When bend is turned off the joint parameters have no effect on the actor. So to slave the scale channels in the eyes to a morph in the head, and turn 'bend' off we could use this in a DIP pz2:

actor leftEye
    {
    
    channels
        {
        scale scale
            {
            valueOpDeltaAdd
                Figure
                head
                NameOfHeadMorph
            deltaAddDelta 
            }
        }
    }

This works fine as long as the scale of the head remains at 100%. But if we try to scale the head we have a new problem, the 'smoothScale' channels where there to make the eyes scale when the head was scaled. In turning off 'bend' we have stopped the influence of the 'smoothScale' channels, so the eyes will no longer scale with the head. I don't think this is a huge problem, if you manually scale the head, you can just scale the eyes manually to the same percentage. Note that when 'bend' is turned off, magnet and wave deformers will have no effect on the actor.

If you are distributing a DIP, you should probably point these things out in the ReadMe file (not that anyone ever reads the ReadMe).


**Method C.**Another approach we can take is to leave 'bend' on, and try to alter the 'smoothZones' in the 'smoothScaleY' channels of the eyes, so that they work better. The values needed for the 'smoothZones' will be specific to the figure.

actor leftEye
    {
    channels
        {
        scale scale
            {
            valueOpDeltaAdd
                Figure
                head
                PBMCC_02
            deltaAddDelta -0.5
            valueOpDeltaAdd
                Figure
                head
                big
            deltaAddDelta 1.4080
            }
        smoothScaleY head_smooY
            {
            //the value below is for V3 SAE and V3 RR.
            smoothZones 0.687434 0.70952 99 100
            //the value below is for Jessi (P6 Woman).
            //smoothZones 0.601353 0.748332 99 100
            //the value below is for Don (P5 Man).
            //smoothZones 0.697943 0.726412 99 100
            //the value below is for P4 Nude Woman.
            //smoothZones 0.655437 0.718358 99 100
            }
        }
    }
actor rightEye
    {
    channels
        {
        scale scale
            {
            valueOpDeltaAdd
                Figure
                head
                PBMCC_02
            deltaAddDelta -0.5
            valueOpDeltaAdd
                Figure
                head
                big
            deltaAddDelta 1.4080
            }
        smoothScaleY head_smooY
            {

            //the value below is for V3 SAE and V3 RR.
            smoothZones 0.687434 0.70952 99 100
            //the value below is for Jessi (P6 Woman).
            //smoothZones 0.601353 0.748332 99 100
            //the value below is for Don (P5 Man).
            //smoothZones 0.697943 0.726412 99 100
            //the value below is for P4 Nude Woman.
            //smoothZones 0.655437 0.718358 99 100
            }
        }
    }

The above is a full pz2, to use it as a snippet in a DIP just leave out the bits in blue, and delete unneeded comment lines. The file is set to work on V3. I have used "//" to "comment out" values for other figures, you can swap the commented out lines to use this on different figures. The values I have used are by their very nature a compromise between getting the eyes to scale well when the head is scaled, and getting the eyes to scale well when the eyes are scaled. The values are probably far from optimal, but I think they should suffice for most cases. They were the result of a few quick trial and error experiments. It was beyond my means to include more than a few figures. I did the ones I still had laying around after my main Poser HDD died.

Whilst you should probably prefer method A, for figures that will respond to the 'Scale' dial whilst 'bend' is turned on. I have included V3 in this file because changing her 'smoothScaleY' channels in this way makes a dramatic improvement to the way the eyes scale when the head is scaled (eg in normal manual operation), it also makes it so that when scaling individual eyes the same value on the scale dial will have the same effect for each eye. However these changes can, and probably will, mess up the way that native and third party ERC scaling affects the eyes, this is because these were designed to work with the original (bad) values of the 'smoothScaleY' channel.


**Method D.**This may be the best method when method A won't work. I won't go into full details here, you should already know how to do much of this stuff from the previous posts. Apply your head morph with a value of one. Create a magnet for the eye, scale the Zone up to a large value, say 10000%. Select the eye, open the Joint Editor, copy the Y value for the 'Center point', and use this as the value for yTran in the Mag Base. Scale the Mag until the eye reaches the required size, spawn a morph, slave this morph to the head morph with a deltaAddDelta value of one. Unlike translations, it is quite acceptable to use a morph to scale the eyes, so long as you use a large scale for the Zone, have the Base in the center of the eye, and only use the 'Scale' dial on the Mag, the eye geometry should stay centered on the 'origin' (a,k.a. "Center Point"). One down side I can think of is the extra file size that will result from using a morph, as opposed to the other methods. On the positive side you are not changing the way the eyes scale, so there should be no potential for conflict with any other ERC eye scaling that may already exist in the file, or that may be injected into it at a future time.


**So which method should you use to scale the eyes?**Really it's your call depending on what factors you consider most important, I don't have a lot of experience in this field to draw on, and the best method may depend on which figure you are using, but so as not to leave you totally hanging, I would suggest this.

If the eyes scale in response to the Scale dial, then usually prefer method A, as this makes no changes to the way eye scaling works, and is more compatible with any native or third party eye scaling that may be used on the same figure. If you need to scale the eyes in cases where the Scale dial does not work, then method A is out, I would tend to opt for method D as my first choice.


NOTES:
If you want to read the value from the Scale dial, rather than Copy & Pasting to Notepad, as suggested. Be aware that you will need to shift the decimal point two places to the left before using it in a scale channel. In other words "100%" on the Scale dial is equal to "1.000" in the channel, and you will still need to subtract one from this value before using it as the 'deltaAddDelta' value. Some figures (eg V3 RR) already have ERC slaving built into the scale channels of the eyes, the scale channel is slaved to various targetGeom channels in the head (you may want to inspect this as a working example of method A).


This brings me to the end of what I have to say about Delta Injection and related issues, at least for the moment. It's time to move on to a new subject.


lesbentley ( ) posted Fri, 18 April 2008 at 8:13 AM · edited Fri, 18 April 2008 at 8:19 AM

readScriptWe came across readScript briefly in "Delta Injection (Part 6)", where it was used in a cr2. A more typical use of readScript is in a pz2, to apply a number of other pz2 files all at once. Say you have two delta injection poses "SexyBody.pz2" and "CuteFace.pz2. Sometimes you just want to use the SexyBody.pz2 and some times you just want to use the CuteFace.pz2, so you don't want to combine them into one DIP file, but sometimes you want to apply both. You can make a third pz2 that uses readScript to apply the other two poses, thus saving you the onerous task of having to click on two things ;P. Here is an example:

{
version
        {
        number 3
        }

        readScript ":Runtime:libraries:SomeFolder:SomeSubFolder:SexyBody.pz2"
        readScript ":Runtime:libraries:SomeFolder:SomeSubFolder:CuteFace.pz2"
}

One weakness of readScript is that it has to use a specific path from 'Runtime' to a file, if the file gets moved for any reason the readScript will not work. Light (lt2} files can be "called" via a readScript in a pz2, as can Camera (cm2) files, and Face (fc2) files. Character (cr2), Props (pp2), and Hair (hr2), can't be called from a pz2 via readScript. A readScript using the normal uncompressed file extensions (pz2, cm2, lt2, lt2, fc2) will also work to call files of the same name, but that use the compressed extensions (p2z, cmz, ltz, fcz). So this file...

{
version
        {
        number 3
        }

        readScript ":Runtime:libraries:Light:Light Sets:Country.<b>lt2</b>"
        readScript ":Runtime:libraries:Camera:Camera Sets:3 quarter left top.<b>cm2</b>"
        readScript ":Runtime:libraries:Face:P4 Basic Expressions:Mean Smile.<b>fc2</b>"
        readScript ":Runtime:libraries:Pose:Jessi Pose:Action:Comic Book:Hero Action 02.<b>pz2</b>"
}

...would also work on files named "Country.ltz", "3 quarter left top.cmz", "Mean Smile.fcz", and Hero Action 02.p2z". It seems that Hand (hd2, hdz) files can also be applied, but note that the hd2 files supplied with Poser are all for the right hand, and when the file is called via readScript you are not prompted for user input as to which hand it is to be applied to. So you see that you can apply many pose type files at once with readScript, you could pose the character, apply a MAT pose, a couple of DIPs, a MOR pose, a Face pose (really just a MOR pose for the face), a light set, and camera settings, all from one pz2 that contained readScript to call other files. I'm almost certain that readScript would be able to call mc6 files, though I have never actually tried this.

NOTE: You should not include a 'figure' block in a pz2 that uses readScript.


EnglishBob ( ) posted Fri, 18 April 2008 at 8:39 AM
Online Now!

Quick question then, to show I'm paying attention in class. :) We know that Poser library files fall into two categories: those that add objects to the scene (CR2, HR2, PP2) and those that modify the existing scene (CM2, FC2, HD2, LT2, MT5, MC6, PZ2). With some exceptions such as the left/right hand choice which is hard coded into Poser, actions can be freely exchanged between the types of each category, but not across categories. For example, a pose file can be renamed to have a .CM2 extension and it will still have the same effect; Poser 6 and 7 use the .PP2 extension for conforming clothes that you might expect to find with a .CR2 extension, and so on. So, if an object adding file can't be called via readScript from a scene modifying file, can it be called from another object adding file? Can a CR2, for example, include readScript which adds a prop? And can it also add a pose? I believe the answer is yes, but I'm not able to test it out right now.


lesbentley ( ) posted Fri, 18 April 2008 at 10:04 AM

@ Bob,

I'm a bit shaky on this readScript stuff myself, haven't played with it much. Using a cr2 to house the readScript, I have had mixed results. Calling a cr2 and a normal joint pz2 did not work for me, and Poser did not seem to like it, it slowed down. Calling a cr2 and a lt2 did work. Calling a cr2, and cm2, sort of worked, but not very well, it took a long time to load, the camera was missing the Hither dial, and Hither seemed to be set to a large value.  Trying to call two cr2's caused bad results.  Calling a cr2 box and ball pp2's seemed to work well, but when I deleted the figure Poser threw a fit (perhaps just a coincidence, or a hangover from some previous test). Calling a cr2 and two boxes only loaded one box.

All tests were done in P6. I think I would want to do a lot of testing, including saving and reloading to pz3 and cr2, with and without other figures in the scene, before I distributed any cr2 with readScript. Personally I am not that interested in readScript, I have never found much use for it to date.


lesbentley ( ) posted Fri, 18 April 2008 at 6:16 PM · edited Fri, 18 April 2008 at 6:29 PM

file_404465.TXT

** Poses and Magnets (Part 1).****MirrorMags2P**

You can use poses on magnets. The file in this Post will only work correctly in P6 or above. Back in 11/July/2003, I posted a pp2 (prop) file containing 2 magnets, and a control prop housing master channels. The magnets were slaved to channels in the control prop, so that both magnets could be adjusted at once. I found it very handy for spawning symmetrical morphs, but it was not very user friendly, even for me who created it. The pp2 was called "MirrorMags" and is still available in the Free Stuff. I have long sought a better way to mirror magnets, but until P6 came along it escaped me. With the introduction of 'createFullBodyMorph' in P6, I could finally implement it as a pose file, at the same time making the operation much simpler. The result is here in this thread "MirrorMags2P" attached above. Save the file to a pose folder, deleting the ".TXT" part of the file extension.

In what follows "magnet" refers to one whole magnet suite**, the Base, Zone, and Mag.   "Base", "Zone", and "Mag", refer to the individual components of the suite.**


**How to use it:**As an example. Load a figure. Select the 'Right Forearm', create a magnet. Select the 'Left Forearm', create a magnet. Apply the MirrorMags2P pose file. If you want you can position the first magnet before applying the pose, don't position the second magnet. Select any part of the first magnet, Mag Base 1, Mag Zone 1, or Mag 1, rotate, translate, or scale it, the corresponding part of the second magnet should follow in mirror symmetry. I usually create the first magnet on the right hand side of the figure, and the second on the left, but this does nor really matter, it can go the other way round. You can also create two magnets on a central body part, it will still work. Try not to have the two Zones overlapping, or at least not overlapping by much, as it can cause a asymmetric morphs. Don't touch any part of the second magnet at all, changing any of its values will destroy the symmetry, if you do accidentally change something, use 'Restore Eliment' on it. One thing that it does not mirror is the Falloff Graph.

Be aware that the pose adds a hidden channel to the BODY, that will be left behind after the magnets have been deleted. This will do no harm, and hardly adds anything to the file size.


**How it works:**The pose only works on the second magnet (except for the 'displayMode'), and the BODY of the figure, using 'createFullBodyMorph' to add one valueParm channel to the BODY, named "vpmm".

The following things are done in the Base, Zone, and Mag. For the rotate and translate channels, there "k" line value (channel value) and 'initValue' is set to zero. We want them to get all their input from the first magnet. These channels are then slaved directly to their corresponding channel in the first magnet with a one-to-one ratio in the 'deltaAddDelta' lines. In some of the channels the 'deltaAddDelta' value needs its sign reversed. When the first Mag moves towards the right hand, we don't want the second Mag to move towards the right hand, we want it to move towards the left hand, keeping things symmetrical. So we need to reverse the sign (put a "-" in front of) the 'deltaAddDelta' value for xTran. A similar logic applies to the yRotate and zRotate channels. The channels we need to reverse the sign for are:

yRotate
zRotate
xTran

The other channels should have a positive value.

With the scale channels it is harder. We need to initialize the "k" line value to zero, but Poser will not let us do this directly, the smallest value it will allow for a scale channel is '0.001' ('0.001' internal, '0.100' on the dial). We set the value to the smallest that poser will allow in the "k" lines, and also in the 'initValue', but we still need to get rid of '0.001'. This is where "vpmm" channel in the BODY comes in, we set this channel to a value of 'k 0 -0.001' to provide our correction factor, then slave the channel to vpmm as well as to the corresponding channel in the first magnet.

Our task is complete, we have all the channels in the second magnet initialised to zero, and getting their input from the first magnet.


This file is "hot off the presses", just made tonight, so there has not been a lot of time for testing, but everything seems to work, if you have any problems with it, let me know. I am really very pleased with this, and rather proud. I think it should be a great help to anyone who makes morphs with magnets. I plan to do another version that includes more than just two magnets. - - - - - -

More on the topic of Poses and Magnets, shortly...


Conniekat8 ( ) posted Fri, 18 April 2008 at 11:22 PM

Amazing thread, love the info you guys are willing to share here!!!

Quick question:
I've always been wanting to have a 'Pose Button' which will call a python script (or some other script) which will launch a specific PDF file.
That way I can have a pose file/button that calls or launches products user manual.

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


lesbentley ( ) posted Sat, 19 April 2008 at 8:16 AM · edited Sat, 19 April 2008 at 8:18 AM

@ Conniekat8,

If it's about Python, you are asking the wrong person here, I can't tell a Python from a Cobra! In a previous post svdl did show the syntax for calling a py script from a poser file. I think it only works in P6 or above:

{
    version
    {
        number 6
    }

    runPythonScript ":runtime:pathscript.py"
}

As to what py script you would need, I seem to remember seeing a thread in the Poser Python Scripting Forum, that described how to do what you want, but can't find it now. Try asking in the Python forum.


SamTherapy ( ) posted Sat, 19 April 2008 at 1:19 PM

For anyone following this thread, I have deleted some of Les's posts at his request because they can cause serious problems with Poser unless applied correctly.

Now returning you to our regular programming...

Coppula eam se non posit acceptera jocularum.

My Store

My Gallery


lesbentley ( ) posted Sat, 19 April 2008 at 1:40 PM

Many thanks to SamTherapy, for his prompt help in deleting my blunder.

I had posted a file "deformTarget.pz2", that can cause Poser to crash if it is applied when anything other than a Mag is the selected item at the time the pose is applied.

I did not realize that the code could cause a crash until after I had posted. I hope I have not caused any problems for anyone. I will try to mend my ways in the future, and check my code more thoroughly before posting.

I do intend to post the code again, but with proper warnings this time. Although it is dangerous, in the sense that it can cause Poser to crash, and thus, cause you to loose any unsaved work, it is also very useful when used with due caution.


lesbentley ( ) posted Sat, 19 April 2008 at 4:05 PM · edited Sat, 19 April 2008 at 4:11 PM

**Poses and Magnets (Part 2).**deformTarget (Add Target to Deform).

This is the revised safe version, though I will give instructions on how you can make it dangerous, if you are the daring type.

When you create a new magnet, the Mag only affects the the actor that was selected when you created the magnet. Sometimes you may also want the magnet to affect the actors on either side of that actor, or even all actors in the figure. From the Mag's Properties, you can use 'Add Element to Deform'. Internally to the Mag's code this adds a line "deformTarget [NameOfActor]". Sometimes you may find it easier to add a 'deformTarget' for all or most of the actors via a pose file. Often it does not matter if most actors are included as 'deformTarget' as only actors that are touched by the Mag Zone will be effected. Sometimes when actors are side by side and very close together like fingers, it may not be a good idea to include them automatically. Below is a pose file to include most (but not all) actors in most figures as deformTarget for the currently selected magnet.

{
//deformTarget.pz2
//Adds the following actors to Mag 1 as deformTarget.
version
    {
    number 3.00
    }

magnetDeformerProp Mag 1
        {
        deformTarget hip
        deformTarget abdomen
        deformTarget chest
        deformTarget neck
        deformTarget upNeck
        deformTarget head
        deformTarget rCollar
        deformTarget rShldr
        deformTarget rForeArm
        deformTarget rHand
        deformTarget lCollar
        deformTarget lShldr
        deformTarget lForeArm
        deformTarget lHand
        deformTarget rButtock
        deformTarget rThigh
        deformTarget rShin
        deformTarget rFoot
        deformTarget rToe
        deformTarget lButtock
        deformTarget lThigh
        deformTarget lShin
        deformTarget lFoot
        deformTarget lToe
        deformTarget genital
        }

figure
    {

    }
}

Once you have added a deformTarget there is no way to remove it, short of saving the magnet suite as a pp2 and text editing it.

In the above file, eyes, fingers, and individual toes, have been left out. You can of course edit the file to include or exclude any actors you like. The above file is for 'Mag 1', and will only work on 'Mag 1', it will not work on 'Mag 2'. You can also make a file that works on 'Mag 2' easily enough, just change the number in the above file. Of course you can include more than one Mag in the pose file. You could also make a generic version that will work on any Mag, but...


**!!! WARNING !!!**If you make the modification explained below, the file can, and probably will, CAUSE POSER TO CRASH, if it is applied whilst anything other than a Mag is the selected item.

This only works in P5 or above. If you replace "magnetDeformerProp Mag 1" in the above file with "actor $CURRENT", it can be used on any magnet. Very handy! The problem is that, you will also be able to apply it to anything else. If you inadvertently have something other than a Mag selected when you apply the pose, it can, and probably will, cause Poser to crash. You have been warned, try this at your own risk. Whilst a Poser crash is unlikely to cause any problems other than loss of unsaved work, if you have spent an hour or two working on a scene, then that is serious enough!


If you do a lot of morphing with magnets, you may want to make several versions of the file, one that affects only the actors in the right leg, one that affects only the left leg, one that affects only the arms, and one that affects only the central body parts. Why do this? For example, you might have a Mag on the rShin, but also want to include the rFoot and rThigh in the affect of the Mag, but you may need to have the Mag Zone so wide that it also covers part of the lShin and lThigh, which you do not want to affect, or you may want to make a "Fat" morph for the whole figure, but because the arms have a different orientation, you need to do them separately. - - - - - -

More on the topic of Poses and Magnets, shortly...


DarkEdge ( ) posted Sat, 19 April 2008 at 4:14 PM

Mr. Bentley,
This is an awesome thread.
You aren't going to disappear after this I hope???

Comitted to excellence through art.


Conniekat8 ( ) posted Sat, 19 April 2008 at 4:16 PM

Thanks Les :) 
Awesome thread, keep it up.  I'll be returning to it many times to learn!
Yes, I don't know much Python either.  Sounds like something worth taking up, at least to the level of making simple function or file calls.

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


lesbentley ( ) posted Sun, 20 April 2008 at 12:14 PM

**Python double invocation from when called from PZ2.**In a couple of places in this thread a method of calling a Python script from a pose file has been mentioned.I have never tried to call a py script from a pz2, so I can't speak from experience, but something I read sugests that there may be a problem with the method stated previously. Quote from dburdick:


It seems that when using the runPythonScript command in a .pz2 file it will run the called python script twice. Quick example: The .pz2 file contains:

{
version
{
number 6
}
runPythonScript ":Runtime:Python:poserScripts:Test.py"
}

The Test.py program contains: print "Hello World" When running this, it will print "Hello World" twice. If I invoke the script from material file (e.g. test.mt5), it runs correctly and prints only once. Any ideas on how to get the runPythonScript command to execute only once from a .PZ2?


This solution was posted by Dimension3D. Quote:- - - - - -

The script is called only once from a pz2 file, if you put the Python call in the second part of the pose. Use the following as pz2:

{
    version
    {
        number 6
    }
}
{
    version
    {
        number 6
        runPythonScript ":Runtime:Python:poserScripts:Test.py"
    }
}

Below is a link to the thread: http://www.renderosity.com/mod/forumpro/showthread.php?thread_id=2732974


DarkEdge ( ) posted Sun, 20 April 2008 at 12:23 PM

May I ask (if you have already provided this then I am sorry for not seeing it) is there a wat to edit a INJ pz2 file that will activate the fbm for you?
I can make an INJ pose but you have to activate the fbm by hand, is there a way that this will be done automatically?

Comitted to excellence through art.


lesbentley ( ) posted Sun, 20 April 2008 at 1:39 PM · edited Sun, 20 April 2008 at 1:42 PM

@ DarkEdge,

actor BODY
        {
        channels
                {
                valueParm PBMCC-01
                        {
                        name DialName
                        initValue 0
                        hidden 0
                        forceLimits 0
                        min -100000
                        max 100000
                        trackingScale 0.004
                        keys
                                {
                                static  0
                                k  0  
                                }
                        interpStyleLocked 0
                        }
                }
        }

Let's say that the channel above is the master channel in the BODY actor for you FBM, in the delta injection pose. You need to change the number, in red above, to "1" (without the quote marks). If you want the morph to stay expressed when you use one of Poser's 'Restore' functions, then you should also set the 'initValue' to "1". If you don't have a valueParm channel in the DIP, then you need to add one, you can use the one above, though of course the internal name and dial neme may need to be diffrent. Or, if you are talking about the sort of INJ pose that uses readScript to call the delta injection poses, then you can put the above code in that file, under the readScript lines.


DarkEdge ( ) posted Sun, 20 April 2008 at 1:56 PM

Great, thanks buddy. 😄

Comitted to excellence through art.


DarkEdge ( ) posted Sun, 20 April 2008 at 2:56 PM

Hmmmm, how could I do this using the following code:

{

version

{

number 6

}

injectPMDFileMorphs :Runtime:Libraries:Pose:DarkEdge:Simon:Panthreious:Panthreious.pmd

createFullBodyMorph Panthreious

}

Comitted to excellence through art.


lesbentley ( ) posted Sun, 20 April 2008 at 3:39 PM

I have never tried this in conjunction with "injectPMDFileMorphs" and "createFullBodyMorph", but I am fairly sure that this would work: {

version
        {
        number 6
        }

injectPMDFileMorphs :Runtime:Libraries:Pose:DarkEdge:Simon:Panthreious:Panthreious.pmd

createFullBodyMorph Panthreious

actor BODY
        {
        channels
                {
                valueParm Panthreious
                        {
                        initValue 1
                        keys
                                {
                                k  0  1
                                }
                        }
                }
        }
}


Jules53757 ( ) posted Sun, 20 April 2008 at 4:33 PM

Be ensured, it works. I did it in 2005 and you can check it with this file: 3d.ulliswelt.com/3d-dateien/Downloads/Miki_Pregnancy_INJ.zip


Ulli


"Never argue with an idiot. They drag you down to their level and beat you with experience!"


DarkEdge ( ) posted Sun, 20 April 2008 at 5:09 PM

Aye, indeed it does work just fine.
Thanks all.

Comitted to excellence through art.


lesbentley ( ) posted Sun, 20 April 2008 at 6:24 PM · edited Sun, 20 April 2008 at 6:29 PM

!!! NEWS FLASH !!!

Well it's news to an old Luddite like me, who only gets DAZ figures when they decide to release them for free. It seems like it's been a time of many corrections in this thread lately.

Many of the files in the section on "Injecting ERC slaving" have code for the eyes. In most figures the eye actors are named "leftEye" and "rightEye". I just found out that in V4, the eye actors are named "lEye" and "rEye". So anyone wanting to use the code examples on V4, will have to edit them change the names of the eye actors.

Short rant follows: WHY THE BLOODY HELL DID THEY DO THAT! It makes a lot of old stuff that could have been used on V4 obsolete. Well perhaps that is why they did it!


svdl ( ) posted Sun, 20 April 2008 at 7:41 PM

Actually, it was a good idea to rename them like that. Now the "symmetry" option of Poser will work - it depends on identical names with an "r" or "l" prefix.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


lesbentley ( ) posted Sun, 20 April 2008 at 10:21 PM · edited Sun, 20 April 2008 at 10:21 PM

Ah ha, that's a point. But then again there are other, better ways, to get the eyes pointing in the same direction, so it's only really a help from the point of view of copying the joint zones, not something most of us need to do every day. Or is there some Python reason here?


svdl ( ) posted Mon, 21 April 2008 at 1:22 AM

There's no reason from a Python standpoint. The only point is mirroring joint parameters and improved consistency

Actually, most of my Python scripts don't use hardcoded body part names. Makes them more generally applicable. For example, my RemoveMorphs script (strips out delta information for all morphs that remain at a value of 0 for the entire animation) works just as well on the Millenium Horse as on Sydney G2 - and it was written before Sydney/P7 existed.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


lesbentley ( ) posted Mon, 21 April 2008 at 12:59 PM · edited Mon, 21 April 2008 at 1:02 PM

file_404666.TXT

** Poses and Magnets(Part 3).****Crappy Elf Ears** (Normal Poses)

You can use normal poses on magnets. By "normal" I mean poses that set rotations and translations. Most of the time there is probably not much reason why you should make these sort of Poses. It's usually easier and better to to save a set of magnets to a Props pallet using "Select Subset" to include the Base, Mag, and Zone, you can include as many magnets as you like in the pp2.

Just to show it does work, and because there are a few situations where this sort of pose can be useful, attached above is the text of a pz2 to give "Victoria 3 SAE" or "Victoria 3 RR" some crappy Elf Ears. Most of the work is done by Mags 1 and 2, Mags 3 and 4 are to tweak the point of the ear.

To use: Load V3, create 4 magnets on her head, apply the pose. It should not matter whether a magnet is selected when you apply the pose, or part of V3.


NOTES:
A magnet is a type of prop, and as with other poses for props, if you want them to work when there is no figure in the scene, you can save them to a Camera folder with a cm2 file extension. - - - - - -

More on the topic of Poses and Magnets, shortly...


lesbentley ( ) posted Mon, 21 April 2008 at 1:03 PM

file_404667.jpg

Here is a picture of the Elf Ears.


lesbentley ( ) posted Thu, 24 April 2008 at 1:41 PM · edited Thu, 24 April 2008 at 1:46 PM

file_404829.jpg

** Poses and Magnets(Part 4).****Changing how magnets display.**

Sometimes when you make morphs with magnets, the Mags and Bases themselves can get in the way of seeing what you are doing. You can hide all the magnets by using "Deformers > Hide All" from the Display menu, but often this is not ideal either, because you need to see the magnets to understand what you are doing. So the hunt is on for a way to keep the magnets visible, but make them less intrusive. We have already seen one way in one of the first posts. Use Outline Display Style:

{

version
        {
        number 5
        }

actor $CURRENT
        {
        displayMode EDGESONLY
        }
}

Even with Outline Style, the magnets can still be intrusive and interfere with our view of the figure. I feel that a better way is to make the Mags and Bases semi-transparent. To make this happen automatically in P6 (the same probably applies to P5 and P7), we need to re-inject the geometry for the Base and Mag, otherwise they will go completely invisible. Below is an example of setting magnets 1 and 2 to be transparent: { version { number 4.01 }

magnetDeformerProp Mag 1
        {
        on
        storageOffset 0 0.3487 0
        objFileGeom 0 0 :Runtime:geometries:deform:magnet.obj
        material magnet2
                {
                tMax 0.8
                } 
        material magnet1
                {
                tMax 0.8
                }
        displayMode USEPARENT
        }

magnetDeformerProp Mag 2
        {
        on
        storageOffset 0 0.3487 0
        objFileGeom 0 0 :Runtime:geometries:deform:magnet.obj
        material magnet2
                {
                tMax 0.8
                } 
        material magnet1
                {
                tMax 0.8
                }
        displayMode USEPARENT
        }

baseProp Mag Base 1
        {
        on
        storageOffset 0 0.3487 0
        objFileGeom 0 0 :Runtime:geometries:deform:base.obj
        material base
                { 
                tMax 0.8
                }
        displayMode USEPARENT
        }

baseProp Mag Base 2
        {
        on
        storageOffset 0 0.3487 0
        objFileGeom 0 0 :Runtime:geometries:deform:base.obj
        material base
                { 
                tMax 0.8
                }
        displayMode USEPARENT
        }
}

The amount of transparency is controlled by the 'tMax' line, "tMax 0.8" means 80% transparent, "tMax 0.75" would be 75% transparent, etcetera. There are only two Mags and Bases in the above example, but you can add as many as you like. This method of re-injecting the geometry to automate the setting of transparency, does not lend itself well to use with 'actor $CURRENT', but if we are willing to add a bit of user intervention we can make a generic version that uses 'actor $CURRENT'. Note that the file below is a little experimental, as I only just discovered this method, use at your own risk:

{
//MagsTransP.cm2
//Makes the selected Mag or Base transparent.
//After apply, open Material Room and toggle "Reflection_Lit_Mult".
version
        {
        number 5
        }

actor $CURRENT
        {
        on
        material magnet2
                {
                KdColor 0.695796 0.575662 0.524193 0 
                KaColor 0.694118 0.572549 0.521569 1 
                KsColor 0.0699931 0.0672007 0.0727855 0 
                tMax 0.9
                } 
        material magnet1
                {
                KdColor 0.764965 0.135012 0.166598 0 
                KaColor 0.764706 0.133333 0.164706 1 
                KsColor 0.112627 0.105592 0.114382 0 
                tMax 0.9
                }
        material base
                { 
                KdColor 0.819989 0.792615 0 0 
                KaColor 0.819608 0.792157 0 1 
                KsColor 0.339971 0.305959 0 0
                tMax 0.85
                }
        displayMode USEPARENT
        }
}

AS well as setting transparency, the above file sets selected the Mag or Base to use Ambient, rather than Diffuse color, via the 'K?Color' lines. These lines are optional, you can leave them out. Here is how to use it. Because we did not inject geometry, when we apply the pose it will make the selected Mag or Base invisible. First apply the pose to all Mags and Bases that you want to make transparent. Then:

For magnets parented to a figure, or to a prop that is itself parented to a figure:
With any Mag, Base, or part of the figure selected, Open the MATERIAL ROOM, and toggle 'REflection_Lite_Mult' off and back on again. All the Mags and Bases should become visible again. If not try "Deformers Display All" in the Display menu.

For Mags and Bases that are parented to a prop that is not itself parented to a figure:
Open the MATERIAL ROOM, select a Mag or Base, toggle 'REflection_Lite_Mult' of and back on again. You will need to repeat this for each individual Mag or Base.


NOTES: - - - - - -

I saved the above file as a cm2 to a camera folder, so I can use it even when no figure is in the scene. If you only need to use it with a figure, you can save it as a pz2 to a Pose folder.

If you can't see the magnets after applying the pose, and doing the tweak in the MATERIAL ROOM, try "Deformers Display All" in the Display menu.

If you want to use the mouse in the document window to select the Mags and Bases for applying the pose, you may find it helps to 'Lock Figure' first, so that you don't inadvertently move anything.

In P4 'tMax' will work without the need to re-inject the geometry. P5 and P7, probably work the same as P6 in this respect, but I have not checked. '$CURRENT' does not work in P4, or previous versions.


More on the topic of Poses and Magnets, shortly...


alizea ( ) posted Sun, 27 April 2008 at 3:10 AM

Quote - This solution was posted by Dimension3D. Quote:- - - - - -

The script is called only once from a pz2 file, if you put the Python call in the second part of the pose.

Use the following as pz2:

{
    version
    {
        number 6
    }
}
{
    version
    {
        number 6
        runPythonScript ":Runtime:Python:poserScripts:Test.py"
    }
}

I've had the same problem ( script run twice ), solved by this solution . But my script(in fact, svdl's script!) is here to create an empty channel in order to inject a custom morph in this empty channel .So the script works, I have the empty channel,but nothing happens to my character , the custom morph is not injected ( I don't have the new dial with its name). I have put the "runPythonScript" lines at the end of my INJ file . Any help please ? Thank you !

Alice's and GND4's Tailor !
Check my free clothing fits : www.alizea3d.com


geralday ( ) posted Sun, 27 April 2008 at 4:59 AM

Thanks Les, I use magnets as one of the tools when making clothes, your pz2 files for adding all body parts, and partially hiding magnets are most useful. Cheers, Gerald.


lesbentley ( ) posted Sun, 27 April 2008 at 7:59 PM · edited Sun, 27 April 2008 at 8:05 PM

@ geralday,

Glag you found it usefull.

@ alizea,

I had a bit of a play with this (using a script from Ockham), I couldn't get it working either. If the injection comes before the py script then the channel is not yet created, so I guess there is nothing to inject into. If the injection data comes after the py script, then the script seems to be blocking the execution of the rest of the pz2.

Sorry, but I have no solution for this. Perhaps if you try asking in the Python Forum, someone may be able to suggest a fix.

[edit] P.S. If you can't get it working perhaps you could use PMD to inject the new channel, though that only works in P6 and up.


lesbentley ( ) posted Sun, 27 April 2008 at 10:48 PM · edited Sun, 27 April 2008 at 10:59 PM

file_405023.jpg

** Poses and Magnets (Part 5).****The FalloffCurve**

Now we are going to "boldly go where no one was gone before" (or very few at least), deep into the Zone, to the very heart of the Sphere, where we will plunge down curves that fall off at a vertiginous angles. This is not for the faint hearted, we may have to send many brave sword wielding Victoria to her death, in the persuit of the advancement of mad science!

The FalloffCurve lives in the 'sphereZoneProp' (Mag Zone), it determines the strength of the effect that the Mag has at different parts of the Zone. The FalloffCurve is a spline curve. In the Poser interface, the FalloffCurve can be edited in the 'Falloff Graph' which is accessed via the Zone's Properties. In the Falloff Graph, the left hand node (or "Control Point") represents the falloff at the center of the Mag Zone, and the right hand node represents the falloff at the outside edge of the Zone, other nodes represent various points between these two extremes. See image above, Fig 1. All images are of the ClothPlain, with translations of the Base and Zone set at zero, and some yTran applied to the Mag. Note that you will get different results if the center of the Zone in not level with the surface to be deformed.

In the 'sphereZoneProp' (Mag Zone), the FalloffCurve is defined by 'falloffCpt' lines like these:

        buildSphere
        newFalloffCurve
        falloffCpt 0 1
        falloffCpt 0.0945946 0.780653
        falloffCpt 0.175676 0.751078
        falloffCpt 0.335135 0.443118
        falloffCpt 0.478378 0.345122
        falloffCpt 1 0
        endFalloffCurve

This defines the same curve as in Fig 1. Each node is defined by two values, I think the first value represents the distance of the node from the edge of the Zone as a percentage of that distance, with "0" being the center of the Zone, and "1" being equal to "100%", the outside edge. The second value represents the strength of the Mag's affect at that point. This value can vary from "0" no effect, to "1" full effect. Let's take a simple case with just two nodes, we can put it in a pose file (see Fig 2):

{
//FallOff-Straight.pz2
//For Mag Zone 1.
version
        {
        number 4.01
        }

sphereZoneProp Mag Zone 1
        {
        buildSphere
        newFalloffCurve
        falloffCpt 0 1
        falloffCpt 1 0
        endFalloffCurve
        }
}

This represents a full effect of the Mag at the center of the Zone, and no effect at the outside edge (see Fig 2). Because there are only two nodes, the falloff "curve" going from 0 to 1, can only be a straight line. This can be a good starting point for making your own FalloffCurve in the Poser Falloff Graph Editor. you can apply this pose to 'Mag Zone 1' then open the Falloff Graph Editor, and add more nodes to make a more complex curve. The default curve has 4 nodes, and is a less flexible starting point because there is no way to delete nodes in the Graph Editor. But you do this at your own risk, this is experimental stuff, bending the curve in the wrong way might rupture the fabric of space-time or something, and God only knows what would happen then! Now let's look at the opposite set-up (Fig 3):

{
//FallOff-Straight-Inverse.pz2
//For Mag Zone 1.
version
        {
        number 4.01
        }

sphereZoneProp Mag Zone 1
        {
        buildSphere
        newFalloffCurve
        falloffCpt 0 0
        falloffCpt 1 1
        endFalloffCurve
        }
}

Position zero, the center of the Zone, has an strength of zero, whilst position 1 (100%), the edge of the zone has an strength of one, full strength (see Fig 3). To get the full strength of the magnet over the whole Zone, no falloff at all, we could use this (fig 4):

{
//FallOff-Zero.pz2
//For Mag Zone 1.
version
        {
        number 4.01
        }

sphereZoneProp Mag Zone 1
        {
        buildSphere
        newFalloffCurve
        falloffCpt 0 1
        falloffCpt 1 1
        endFalloffCurve
        }
}

With 3 nodes we can start to get a curve, even when the center of the Zone is on the surface (Fig 5): { //FallOff-Concave.pz2 //For Mag Zone 1. version { number 4.01 }

sphereZoneProp Mag Zone 1
        {
        buildSphere
        newFalloffCurve
        falloffCpt 0 1
        falloffCpt 0.5 0.246633
        falloffCpt 1 0
        endFalloffCurve
        }
}

Here is a dome (Fig 6): { //FallOff-Dome.pz2 //For Mag Zone 1. version { number 4.01 }

sphereZoneProp Mag Zone 1
        {
        buildSphere
        newFalloffCurve
        falloffCpt 0 1
        falloffCpt 0.5 0.75
        falloffCpt 1 0
        endFalloffCurve
        }
}

Here is a more complex curve, a "fountain": { //FallOff-Fountain.pz2 //For Mag Zone 1. version { number 4.01 }

sphereZoneProp Mag Zone 1
        {
        buildSphere
        newFalloffCurve
        falloffCpt 0 1
        falloffCpt 0.256757 0.144004
        falloffCpt 0.47027 0.320245
        falloffCpt 0.5 0.221285
        falloffCpt 0.686486 0.20976
        falloffCpt 0.848649 0.219915
        falloffCpt 0.905405 0.118923
        falloffCpt 0.92973 0.00596022
        falloffCpt 0.959459 0.00139323
        falloffCpt 1 0
        endFalloffCurve
        }
}

This is all I can think of to say about poses and magnets, at the moment, except to say I am working on a new pose based version of MirrorMags that will support a lot of magnets. I hope to release it soon.


lesbentley ( ) posted Tue, 29 April 2008 at 2:52 AM

Pose Overflow.

A problem.

The Pose Overflow problem seems to have been fixed in P6, I'm not sure if the problem existed in P5.

In Poser 4 I used to get a problem that I call "Pose Overflow". As an example, say I have a pose file that was made for V3, V3 has buttock actors. I have a scene that contains both V3 and the P4 Nude Woman. I apply the pose for V3 to the P4 Nude woman, because Poser 4 can not find any buttock actors in the the P4 Nude Woman, the pose data for the buttocks can overflow and be applied to V3. The same can happen when a pose for a character is applied to an item of conformed clothing, any pose data that does not pertain to actors in the clothing, can overflow and be applied to the character.


EnglishBob ( ) posted Tue, 29 April 2008 at 3:22 AM
Online Now!

Attached Link: Tip: Applying a pose to a figure and its clothing [PoserPros thread]

Yet sometimes pose overflow is useful - see the linked thread. There, I apply a single pose which contains both the skirt morphs and the figure pose to a conformed skirt; the figure's entries don't apply to the skirt, and overflow into the figure so it takes up the pose which goes with the skirt morphs. I'm not certain if I've tried this in Poser 6. I don't remember seeing it not work, anyway; that may mean it worked, or it may mean I haven't tried it. :)


lesbentley ( ) posted Tue, 29 April 2008 at 4:28 AM · edited Tue, 29 April 2008 at 4:39 AM

@ Bob,

Yes, I agree, pose overflow can be more of a blessing than a curse. For better or worse, it seems to be gone in P6. I think it still used to happen in P5, but can't remember for sure. I did a few tests in P6, with and without actor numbers (:#) in the pz2, with and without one figure parented to the other, there was no spillover of the pose in P6.

Any way it's too finer day to ruminate over Poser, I'm off to climb Pendle Hill!


lesbentley ( ) posted Wed, 30 April 2008 at 10:31 AM · edited Wed, 30 April 2008 at 10:45 AM

Hidden (Part 1).'hidden 1' and 'hidden 0'. Hide actors from menu, or dials from parameter pallet.

Loosely speaking we often use the word "hide" to mean hide an element from the scene. However, the hidden switch (or "flag") should not to be confused with the visibility switch. In Poser script the on/off switch is used to control visibility of actors (body parts or props) in the document (scene) window, and the 'displayOn' switch in the 'figure' section is used to turn visibility off or on for the entire figure.

The 'hidden' switch has a different purpose, it does not hide anything from the document window. The 'hidden' switch is used to hide actors or dials from the menus and pallets. 'hidden 1' is used to hide something, and 'hidden 0' to display it.


**The use of 'hidden' in channels.**This pz2 file will hide all the rotate dials in the hip from the parameters pallet, you may have to select some different actor, then reselect the hip to refresh the pallet and make the dials hidden:

version
    {
    number 3.00
    }

actor hip
        {
        channels
                {
                rotateY yrot
                        {
                        hidden 1
                        }
                rotateX xrot
                        {
                        hidden 1
                        }
                rotateZ zrot
                        {
                        hidden 1
                        }
                }
        }

figure
        {

        }
}

You will still be able to manipulate the rotate of the actors via the Rotate or Twist Tool and mouse. If you wanted to stop the influence of the mouse, you could force limits and set 'min' and 'max' to zero (or some other value). For P5 or above you can make generic hide or unhide poses that will work on any actor, prop, light, or camera, eg:

{
version
    {
    number 5
    }

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

In a figure, the translate channels of most actors are hidden, you can use the above pose to unhide them. You can do the same for scale channels. The file below may be useful for V4, where I hear that the scale channels are hidden by default.

{
version
    {
    number 5
    }

actor $CURRENT
        {
        channels
                {
                scale Scale
                        {
                        hidden 0
                        }
                scaleX xScale
                        {
                        hidden 0
                        }
                scaleY yScale
                        {
                        hidden 0
                        }
                scaleZ zScale
                        {
                        hidden 0
                        }
                }
        }
}

**The use of 'hidden' in actors.**The 'hidden' switch can also be used in actors, placed before the 'channels' section it will hide the entire actor from menus and pallets. When used in the actor 'hidden' performs the extra function of hiding the actor from the influence of the mouse in the document window. Here is a pose to hide the hip:

{
version
    {
    number 3
    }

actor hip
        {
        hidden 1
        }
}

Here is a generic version to hide the selected actor, prop, light or camera: { version { number 5 }

actor $CURRENT
        {
        hidden 1
        }
}

NOTES:
Poses will still work as normal when an actor or channel is hidden. When an actor or channel is hidden, it is still accessible through the Hierarchy Editor. Selecting a hidden actor in the Hierarchy Editor will force it to display in the parameters pallet and menus, selecting a hidden channel in the Hierarchy Editor (using 'Show All Parameters') will display the dial in the parameters pallet. When a different actor is selected the dial or actor will revert to its hidden status.

If some hidden actor was the selected part when a figure was saved, that actor will be unhidden when the figure is reloaded, but will revert to hidden as soon as some other actor is selected.

The 'targetGeom' (morph) channel is a special case. A pose file can hide a  'targetGeom'  channel for the current session, but if the channel contains deltas it will display again after a reload. If a 'targetGeom' channel that contains no deltas is hidden it will remain hidden. When Poser reads the deltas in a 'targetGeom' channel this will unhide the channel. There are a number of events that will cause reading of the deltas, and thus unhiding of the channel, these include:

Reloading a pz3.
Reloading a figure that was saved to a Figures pallet (same applies to a pp2).
Injecting deltas into the channel.

If you want a figure to load with morph channels hidden, you can place the 'hidden 1' at the very end of the channel, after the deltas, just above the closing brace for the channel, but any of the events above will still cause the channel to display.


To be continued...


lesbentley ( ) posted Fri, 02 May 2008 at 3:12 PM · edited Fri, 02 May 2008 at 3:19 PM

file_405319.TXT

**Hidden (Part 2).****Conformers and 'hidden'.**

There was a problem in P4, and I think it also happens in P5, but can't remember for sure. In P6 the problem seems to have been solved.

The Problem in P4 is that, if you have an item of clothing conformed to a character, when trying to select part of the character with the mouse, you can easily end up selecting part of the clothing instead. You can apply the "Hidden 1.pz2" file attached above, to the clothing, to hide all its actors, so that only the character can be selected.

Because of "Pose Overflow" mentioned in a previous post, you will probably also need to apply the "Hidden 0.pz2" to the character, to undo any hiding that spilled over into the character. I will attach the "Hidden 0.pz2" file to my next post, it is exactly the same as the "Hidden 1.pz2", except all instances of 'hidden 1' have been replaced with 'hidden 0'.

As I said, P6 has solved this problem, the mouse will always act on the character in preference to the conformed item. However you may still find a use for the "Hidden 1.pz2" in P6 or above. In P6 you can use it on the character rather than the conformer, if you want to be able to select parts of the conformer via the mouse.

The "Hidden 1.pz2" and "Hidden 0.pz2" files should work on most figures to hide most body parts, but they assume a standard list of actor names, some figures may use different, or extra, actor names.


NOTES:
As with all my attachments to this thread, I have had to add a ".TXT" extension to the file name, so that the Rosity will accept the attachment. You will have to remove the ".TXT" part of the file extension before you can use it in Poser. Hidden actors can still be selected via the Hierarchy Editor.


lesbentley ( ) posted Fri, 02 May 2008 at 3:21 PM

file_405323.TXT

** Attached above is the text of the "Hidden 0.pz2"**, to undo the hiding caused by the "Hidden 1.pz2" in my last post.


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.