lesbentley opened this issue on Mar 31, 2008 · 137 posts
lesbentley posted Mon, 31 March 2008 at 7:49 PM
A Compendium of PZ2 Techniques.
This thread is aimed at people who have some experience of text editing Poser library files.
It seems that there are questions about pose (*.pz2) files that keep coming up from time to time. Pose files can do much more than just pose a figure. They can hide or lock actors, scale, smartparent, change materials (MAT poses), change joint parameters, inject new geometry into props and actors, inject morphs and ERC, to name a just few things.
I thought it might be useful to have a compendium of pz2 examples in one thread, rather than posting the same answers over and over. In learning about pz2 files you will also learn a lot about how pp2 (prop) and cr2 (character) files work.
Most of the pz2 files in this thread will need to be constructed or edited in a text editor or a cr2 editor, they are not in general things that can be saved directly from the Poser interface. When you do need to save a pose file in Poser as the basis for further editing, make sure you have "Use file compression" turned off in the General Preferences, so that the result is a plain text file. For some pose files relating to morphs it may also be necessary to have "Use external binary morph targets" turned off.
In my pz2 files I usually do not use the colon and actor number (:1), in most cases it does not matter if this is included or not, but in pose files that inject or modify ERC slaving code the ":1" should in general NOT be used, and you should use "Figure" NOT "Figure 1" in most slaving code.
Lines starting with "//" or "#" are comment lines, these lines will be ignored by Poser. All the files I post in this thread have a pz2 file extension unless otherwise stated. Be aware that most pz2 files can be placed in a camera folder if you change the file extntion to cm2, or in a lights folder if you change the extension to lt2, or in a face folder if you change the extension to fc2.
All the pose files I post here have been tested in Poser 6, but there is always a chance that some particular pose will not work as expected in some set of circumstances, or that I have made a typo. I welcome corrections if anyone spots errors in this thread.
Feel free to add your own pz2 techniques to this thread, but please check your work for errors before posting, and post a working example, either as a text attachment (*.txt), or pre-formatted text.
To display pre-formatted text in a post you enclose the code in the HTML 'pre' tags "
" and ";". When you include pre-formatted text you need to use the "Source" button in the Renderosity "Reply" box, before pasting your text in. Because the "Source" button will change the way text is formatted, you will need to use paragraph tags
to get paragraph breaks in any text that is outside the pre tags.
Enough preamble, in my next post I will give some examples of pz2 files.
lesbentley posted Mon, 31 March 2008 at 7:57 PM
OK, here are some example pz2 (pose) files.
Make actors INVISIBLE:
{
version
{
number 3
}
actor leftEye
{
off
}
actor rightEye
{
off
}
actor head
{
off
}
Figure
{
}
}
Make actors VISIBLE: {
version
{
number 3
}
actor leftEye
{
on
}
actor rightEye
{
on
}
actor head
{
on
}
Figure
{
}
}
Lock actors: {
version
{
number 3
}
actor hip
{
locked 1
}
actor abdomen
{
locked 1
}
actor chest
{
locked 1
}
Figure
{
}
}
The pz2 file to unlock actors is exactly the same, except it uses "locked 0" in place of "locked 1". - - - - - -
A pz2 to scale the BODY actor to 200%. {
version
{
number 3
}
actor BODY
{
channels
{
propagatingScale scale
{
keys
{
k 0 2
}
}
}
}
Figure
{
}
}
NOTES: - - - - - -
Most figures use "propagatingScale" for the channel type in the BODY actor, and "scale" in all the other actors. Note the upper case "S" in "propagatingScale". - - - - - -
A pz2 to scale the 'head' actor to 150%. {
version
{
number 3
}
actor head
{
channels
{
scale scale
{
keys
{
k 0 1.5
}
}
}
}
Figure
{
}
}
Note that in a scale channel the number on the left of the decimal point represents hundreds, the number on the right of the point represents ten's. So "0.9" would be a scale of 90%, and "0.0525" would be a scale of 5.25%. The default value of a scale channel is "1.0" which is 100%. - - - - - -
**Forcing Limits.**In Poser's Figure menu you have an option to "Use Limits", when this option is turned on all channels in the scene are constrained between the values set by the 'min' and 'max' lines in the particular channel. "Use Limits" is a global switch, when turned on it applies to everything in the document (scene). You could use a pose to set this switch:
{
version
{
number 3
}
doc
{
useLimits 1
}
}
There is little point in the above pose, as you can easily turm the feature on or off from the Figure menu. However some times you may want to set limits for some channels but not for the whole document. For this you can use the 'forceLimits' line in the individual channels, a value of 1 turns it on a value of 0 turns it off. Lets take an example. Say you have a figure with an alien head morph. The eyes have had to be moved to fit the morphed position of the eye sockets. All is well until you come to apply a stock pose to the figure. Because the stock pose contains data for the translate channels, it resets the translations of the eyes to zero. How can you prevent this? One way is to force the limits on the translate channels, as in the pz2 below (I will show a different way to overcome this problem later).
A pz2 to force limits for translations of a figure's eyes:
{
version
{
number 3
}
actor leftEye
{
channels
{
translateX xtran
{
forceLimits 1
min 0.002
max 0.002
}
translateY ytran
{
forceLimits 1
min 0
max 0
}
translateZ ztran
{
forceLimits 1
min 0.00311
max 0.00311
}
}
}
actor rightEye
{
channels
{
translateX xtran
{
forceLimits 1
min -0.002
max -0.002
}
translateY ytran
{
forceLimits 1
min 0
max 0
}
translateZ ztran
{
forceLimits 1
min 0.003125
max 0.003125
}
}
}
Figure
{
}
}
The pose files in the examples each tend to do one thing, but there is nothing to stop you mixing and matching, you can carry out many functions in a single pose file. I hope to add some more examples of pz2 files soon.
RAMWorks posted Mon, 31 March 2008 at 8:16 PM
SamTherapy posted Mon, 31 March 2008 at 8:18 PM
Thanks for this, Les. Very useful stuff.
Coppula eam se non posit acceptera jocularum.
svdl posted Mon, 31 March 2008 at 9:43 PM
You can add Poser 5 style grouping of parameter dials using a pose file:
<font size="1"><font size="1">{<br></br>
version<br></br>
{<br></br>
number 5<br></br>
}<br></br>
actor BODY<br></br>
{<br></br>
channels<br></br>
{<br></br>
groups<br></br>
{<br></br>
groupNode Glute-Hip-Abs<br></br>
{<br></br>
collapsed 1<br></br>
parmNode
PBMExOblique<br></br>
parmNode PBMErectorSpin<br></br>
parmNode PBMStomachIn<br></br>
parmNode PBMTummyOut<br></br>
parmNode
PBMLineaAlba<br></br>
}<br></br>
groupNode Legs-Feet<br></br>
{<br></br>
collapsed 1<br></br>
parmNode PBMThighFull<br></br>
}<br></br>
}<br></br>
}<br></br>
}<br></br>
actor hip<br></br>
{<br></br>
...<br></br>
}<br></br>
}<br></br>
</font></font>
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
pjz99 posted Mon, 31 March 2008 at 9:51 PM
Neat stuff guys :)
lesbentley posted Mon, 31 March 2008 at 10:05 PM
Good one svdl!
One of my favourite uses for this trick is to make a pz2 that places the transform dials above the morph dials. Then place this code in a Pose Dot so it is always close to hand. I can't stand wading through 30 odd morph dials to get to the transforms!
lesbentley posted Mon, 31 March 2008 at 10:17 PM
Poses for Props.
An exercise to try to improve understanding of poses for props.
If you are the impatient type who does not like working through exercises, you might like to skip this post and go straight to the next one "Poses for Unparented Props".
If a prop is parented to a figure, saving a pose for the figure will also save the pose for the prop. Try this exercise. Load a figure, load a box prop, place the prop on the figures head, rotate the prop 45 degrees. Parent the box to the head. Save a pose for the figure, name it "A1". Save another pose, name it "A2", but this time use "Select Subset" to exclude everything from the pose except the box. Now save the figure as "BoxHead".
Pose the figure, now 'Restore' the box (with the box selected, Ctrl+E), the box should fall from the head. Now apply the A2 pose the the figure, the box should return to the head without affecting the rest of the figure. Restore the box again, now apply the A1 pose, this time both the figure and box should return to their original pose.
We have learned that in Poser we can save a pose for the figure plus its parented prop(s), or just save a partial pose for for the parented prop(s) without including the figure. If we wanted we could also have used "Select Subset" to save a pose for the figure that did not include the prop(s).
Now load the "BoxHead" figure in the same document (scene), select its Body actor and move it slightly to the side, out of the way of the first figure. Select the box on its head and do Ctrl+E. Now apply the A2 pose, nothing happens, why?
Poser will only allow one instance of a prop named "box_1" in the document. When we loaded the "BoxHead" figure Poser changed the name of the prop to "box_2", as our pose files refer to "box_1" they will not work on "box_2". We have found a limitation on poses for props that can cause a lot of trouble if we are not aware of it.
Delete the "BoxHead" figure. Select the box on the head of the original figure and do Ctrl+E. Now unparent the box (set the parent to 'UNIVERSE"). Apply either the A1 or A2 pose, nothing happens, why?
The type of prop pose we can make in Poser only works when the prop is parented to a figure!
We can modify the poses so that they work even if the prop is not parented to a figure. Open the A2.pz2 in a text editor. change the line "prop box_1:1" to read "actor box_1", resave the file. When we address the prop as "actor" the prop does not need to be parented to a figure for the pose to work. Note well though, that a figure must be present in the document for any pp2 file to work on anything.
Q: Is there no way to pose a prop, if there is no figure in the document?
A: We can pose a prop, even if there is no figure in the document, it's just that we can't use a pz2 file to do the posing. I will explain this along with some other things, in my next post "Poses for Unparented Props".
lesbentley posted Mon, 31 March 2008 at 11:54 PM
**Poses for Unparented Props.**I have called this post "Poses for Unparented Props", but the pose file in this post will also work on a parented prop, as will almost all poses constructed for unparented props.
As we saw in my last post, poses made in Poser won't work on props that are not parented to a figure.
If we want to pose unparented props we have to make a slight change from the syntax that Poser uses to save a pose. Instead of addressing "prop PropName_1", we need to address the prop as "actor", e.g. "actor PropName_1".
Below is an example of a pz2 that will pose an unparented prop named "ball_1" (the first instance loaded of a Poser Ball primitive). Remember there needs to be a figure in the document before this will work, even though the prop does not need to be parented to the figure.
Pose for an Unparented Ball Prop:
{
version
{
number 3
}
actor ball_1
{
storageOffset 0 0.3487 0
objFileGeom 0 0 :Runtime:Geometries:props:box.obj
}
actor ball_1
{
channels
{
rotateY yrot
{
keys
{
k 0 45
}
}
scale scale
{
keys
{
k 0 1.5
}
}
}
material Preview
{
KdColor 1 0 0 1
}
}
}
The above pz2 file will make a number of changes to the Ball prop. First it will inject the Box geometry, turning the ball into a box, it will yRotate the prop 45º, it will scale the prop to 150%, and finally it will change the defuse color to red. - - - - - -
**Pose a prop when no figure in the scene.**Q: OK, we now know how to pose an unparented prop, but we still need a figure in the scene. Can we delete the figure and still be able to pose the prop?
A: We can pose a prop when there is no figure in the scene, we just can't use a pz2 file to do it, no pz2 file will work without a figure present.
To pose a prop without a figure present, we can save our pose file to a camera folder, and give it a cm2 file extension. Cm2 files to not need a figure present in order to work, most pose files for props (all the ones I have tried so far) will work from a camera folder if you give them a cm2 file extension. Try it, take the pose file above and save it as a cm2.
In my next post I will adress some uses of "actor $CURRENT" and give some more examples of poses that can be used on props.
lesbentley posted Tue, 01 April 2008 at 1:02 AM
Generic Pose files using "actor $CURRENT".- - - - - -
In P5 and up you can make a generic pz2 that will apply whatever settings it contains to the currently selected body part, prop, light, camera, magnet, or anything else you can think of. This is done by using the "actor $CURRENT" statement. This statement can only work on one actor at a time. Below is an example of using "actor $CURRENT" to change the Display Style of the currently selected actor to Outline Display Style: {
version
{
number 5
}
actor $CURRENT
{
displayMode EDGESONLY
}
}
The types of displayMode are:
EDGESONLY (Outline)
WIREFRAME (Wireframe)
HIDLINE (Hidden Line)
SHADEDOUTLINE (Lit Wireframe)
FLATSHADED (Flat Shaded)
FLATLINED (Flat Lined)
CARTOONNOLINE (Cartoon) SKETCHSHADED(Cartoon w/Line)
SHADED (Smooth Shaded)
SMOOTHLINED (Smooth Lined)
TEXTURESHADED (Texture Shaded)
USEPARENT (This is the default style)
"actor $CURRENT" is not limited to displayMode, you can use it with almost any type of pose, so long as you only need to affect one actor at a time.
A generic pose to scale the selected actor to 200%: {
version
{
number 5
}
actor $CURRENT
{
channels
{
scale scale
{
keys
{
k 0 2
}
}
}
}
}
Make selected actor INVISIBLE: {
version
{
number 5
}
actor $CURRENT
{
off
}
}
The file to make the actor visible is exactly the same, except it uses "on" in place of "off" - - - - - -
Lock selected actor: {
version
{
number 5
}
actor $CURRENT
{
locked 1
}
}
The pz2 file to unlock actor is exactly the same, except it uses "locked 0" in place of "locked 1". - - - - - -
NOTES:
All the pose files above in this post can be used on figures or props, but remember that if you want to pose a prop when there is no figure in the scene you will have save the file to a camera folder and give it a cm2 file extension, the same goes if you want to apply it to a light or camera when there is no figure present. Remember "actor $CURRENT" only works in P5 or above, it will not work in P4.
EnglishBob posted Tue, 01 April 2008 at 6:12 AM
Saving this thread, thanks les. Very useful to have it all gathered together.
lesbentley posted Tue, 01 April 2008 at 5:34 PM
**Main Camera Fill Light.**Sometimes it can be handy to have a fill light parented to the main camera.
If you apply this file to a spotlight, it will place the light at the Main Camera (icon) and parent it to the camera. It will also set the colour of the light to white, the intensity to 15% (k 0 0.15), clear any nodes in the lights shaderTree.
{
//MainCamFill.cm2 or MainCamFill.pz2 or MainCamFill.mt5
//to work when no figure in scene, needs to be cm2 or mt5
version
{
number 5
}
actor $CURRENT
{
on
smartparent MAIN_CAMERA
channels
{
kdRed RED
{
initValue 1
keys
{
k 0 1
}
}
kdGreen GREEN
{
initValue 1
keys
{
k 0 1
}
}
kdBlue BLUE
{
initValue 1
keys
{
k 0 1
}
}
kdIntensity INTENSITY
{
initValue 0.15
keys
{
k 0 0.15
}
}
shaderNodeParm Preview_Light_0_R
{
initValue 1
keys
{
k 0 1
}
}
shaderNodeParm Preview_Light_0_G
{
initValue 1
keys
{
k 0 1
}
}
shaderNodeParm Preview_Light_0_B
{
initValue 1
keys
{
k 0 1
}
}
shaderNodeParm Preview_Light_1
{
initValue 0.15
keys
{
k 0 0.15
}
}
rotateX xrot
{
initValue 0
keys
{
k 0 0
}
}
rotateY yrot
{
initValue 0
keys
{
k 0 0
}
}
rotateZ zrot
{
initValue 0
keys
{
k 0 0
}
}
translateX xtran
{
initValue 0
keys
{
k 0 0
}
}
translateY ytran
{
initValue 0
keys
{
k 0 0
}
}
translateZ ztran
{
initValue 0.1
keys
{
k 0 0.1
}
}
}
material Preview
{
KdColor 1 1 1 1
KaColor 0 0 0 1
KsColor 1 1 1 1
TextureColor 1 1 1 1
shaderTree
{
}
}
}
figure
{
}
}
NOTES: Because this file uses "actor $CURRENT" it will only work in P5 or later versions.
'initValue' lines have been used in the channels. 'initValue' is the value that will be used when one of the 'Restore' commands from the Edit menu is used.
**Poser script provides a switch to turn a light on (or off) 'lightOn 1(0), however this switch will not work from a pose file where 'actor $CURRENT' is used to address the light. For this switch to work the light must be addressed by its name, eg "light spotLight 1".
**
In Poser script, comment lines start with "//" or "#", these lines will be ignored by Poser. It is good practice to include a comment line(s) under the opening brace of a pose file to explain which item it is meant to be applied to, and/or what it does.
manoloz posted Tue, 01 April 2008 at 7:34 PM
bookmarked
still hooked to real life and enjoying the siesta!
Visit my blog! :D
Visit my portfolio! :D
lesbentley posted Tue, 01 April 2008 at 8:32 PM
TIP:
The Poser interface has 9 Pose Dots. These Pose Dots use pz2 files, which are named "poseDot_1.pz2" through "poseDot_9.pz2" (if they are compressed, I think the file extension is "p2z"). You can place handmade poses in these these files if you wish. It is generally quicker to access a Dot than a file in a pose pallet. Just name the file "poseDot_[someNumber].pz2", and save it to the appropriate folder.
The location of the Dots can vary according to the Poser version, in P6 they live in:
RuntimedotsPoseRoom
If you can't find them in your version, use the Windows Search to find "poseDot_".
pitklad posted Tue, 01 April 2008 at 9:36 PM
Quote - TIP:
The Poser interface has 9 Pose Dots. These Pose Dots use pz2 files, which are named "poseDot_1.pz2" through "poseDot_9.pz2" (if they are compressed, I think the file extension is "p2z"). You can place handmade poses in these these files if you wish. It is generally quicker to access a Dot than a file in a pose pallet. Just name the file "poseDot_[someNumber].pz2", and save it to the appropriate folder.The location of the Dots can vary according to the Poser version, in P6 they live in:
RuntimedotsPoseRoom
If you can't find them in your version, use the Windows Search to find "poseDot_".
Fantastic idea! Thanks for sharing!
Nice way to have utility poses handy!!!
Jules53757 posted Wed, 02 April 2008 at 1:33 AM
Bookmarked
Ulli
"Never argue with an idiot. They drag you down to their level and beat you with experience!"
vincebagna posted Wed, 02 April 2008 at 1:52 AM
bookmarked
nghayward posted Wed, 02 April 2008 at 1:56 AM
Quote - TIP:
The Poser interface has 9 Pose Dots. These Pose Dots use pz2 files, which are named "poseDot_1.pz2" through "poseDot_9.pz2" (if they are compressed, I think the file extension is "p2z"). You can place handmade poses in these these files if you wish. It is generally quicker to access a Dot than a file in a pose pallet. Just name the file "poseDot_[someNumber].pz2", and save it to the appropriate folder.The location of the Dots can vary according to the Poser version, in P6 they live in:
RuntimedotsPoseRoom
If you can't find them in your version, use the Windows Search to find "poseDot_".
In Poser 7 they are in (For winxp)
?:Documents and Settings
semidieu posted Wed, 02 April 2008 at 5:43 AM
Bookmarked.
For the group pose file, don't forget that thy are not 'additive'. They will destrcut the previous grouping information
lesbentley posted Wed, 02 April 2008 at 1:46 PM
Thanks semidieu, that's a good tip!
Jean-Luc_Ajrarn posted Wed, 02 April 2008 at 2:59 PM
Thanks so much! :)
dlk30341 posted Wed, 02 April 2008 at 3:04 PM
Fabulous - bkmkd :)
lesbentley posted Wed, 02 April 2008 at 6:41 PM
**Injecting ERC slaving (part 1).**Pose files can be used to inject ERC slaving code into a figure, prop, light, camera, hair, or magnet.
Let's take a very simple example to start with. If you apply the pz2 file below to almost any figure, using the yTran dial on the BODY will cause the hip to rotate.
{
//UpTwist.pz2
//This slaves yrot in the hip to ytran in the BODY.
version
{
number 3
}
actor hip
{
channels
{
rotateY yrot
{
valueOpDeltaAdd
Figure
BODY
ytran
deltaAddDelta 100.000000
}
}
}
figure
{
}
}
Let's have a closer look at this file. Most of it is just to define the hierarchy structure, so that Poser knows where to place the code. The interesting part is the slaving code: valueOpDeltaAdd [type of slaving]
Figure [Defines which figure has the master channel. In a cr2 "Figure" is followed by a number. Leave number out in a pz2]
BODY [the actor where the master channel lives. Leave out the ":#" in a pose file]
ytran [the name of the master channel]
deltaAddDelta 100.000000 [control ratio, how strongly the slave is to be affected by the master]
So the first line is the type of slaving, the second says which figure the master channel is in, the third says which actor to look in for the master channel, the fourth line is the name of the master channel (either internal, or dial name can be used), the fifth line is a control ratio that tells Poser how strongly to affect the channel.
It is beyond my scope here to give a full explanation of ERC (a.k.a. "EMC").
One point to note with ERC slaving. The position of the master channel in the parenting chain will determine whether or not the slave can "see" it. Slaves may have trouble seeing masters that are below them in the parenting chain. I think the situation with regard to this is better in P6 than earlier versions.
See the links below for more details of how ERC works.
http://www.rbtwhiz.com/rbtwhiz_ERC.html
http://www.nerd3d.com/modules.php?name=Content&pa=list_pages_categories&cid=1
http://www.atlantis23.com/erc_download.html
To be continued...
alizea posted Wed, 02 April 2008 at 11:38 PM
Fabulous stuff - thank you so much !
Alice's and
GND4's Tailor !
Check my free clothing
fits : www.alizea3d.com
lesbentley posted Fri, 04 April 2008 at 2:12 PM
**Injecting ERC slaving (part 2).
Squint eyes.**In my last post I showed how we can slave one channel to another. You will notice that is was not necessary to include the master channel in the pose file, it was sufficient to "point" to the master channel in the slaving code. Sometimes we may need to change things in the master channel as well. The next example is such a case.
The next example is a pz2 that can make V3 (or any figure that uses PBMCC_## channels) squint. The pz2 slaves the 'yrot' channels in both eyes to the 'PBMCC_16' channel in the head:
{
//V3_Squint.pz2
//For V3 and similar figures.
//Adds dials to the head to rotate both eyes at once.
version
{
number 3
}
//The section below sets up the initial state of the master targetGeom channel in the head,
//note in particular the use of 'indexes 0' to clear any deltas from the channel.
actor head
{
channels
{
targetGeom PBMCC_16
{
name Eyes_Squint
initValue 0
hidden 0
forceLimits 1
min -5.5
max 5.5
trackingScale 0.02
keys
{
static 0
k 0 0
}
interpStyleLocked 0
indexes 0
}
}
}
//The section below is used to inject slaving code into the 'yrot' channel of the eyes.
actor leftEye
{
channels
{
rotateY yrot
{
valueOpDeltaAdd
Figure
head
Eyes_Squint
deltaAddDelta -10.000000
}
}
}
actor rightEye
{
channels
{
rotateY yrot
{
valueOpDeltaAdd
Figure
head
Eyes_Squint
deltaAddDelta 10.000000
}
}
}
figure
{
}
}
NOTES: If the head (rather than some other part) is selected when you apply the file, then the new dial may not show in the parameters pallet. Select some other body part, then reselect the head, this should cause the parameter pallet to refresh, and you will be able to see the new dial.
Let's take a closer look at this file. We are using 'targetGeom PBMCC_16' in the head as the master channel. First we give the dial a descriptive name "Eyes_Squint". We need to ensure that the value it will be Restored to is zero, and that it is not hidden from the parameters pallet, the next two lines take care of that. 'forceLimits 4' constrains the value of the channel to between the values in the 'min' and 'max' lines ('forceLimits 4' also works). The value of the 'trackingScale' at 0.02 is the default for a targetGeom channel that contains no deltas, and unlike in most other channel types it can not be changed. The last line in this channel is 'indexes 0' this deletes any morph deltas that may be in the channel, we don't want V3 turning into an alien as we squint her eyes (or perhaps sometimes we do).
The next section injects the slaving code into the 'yrot' channels of the eyes. We can slave the channels to either the internal name of the master 'PBMCC_16' or to its dial name 'Eyes_Squint', above I have used the dial name. This is normal practice when slaving to a targetGeom or valueParm channel. When we slave to the dial name the slaving can be broken because a pose file can inject a new dial name, being able to break the slaving can be useful in some situations. If we had slaved to the internal name, the slaving could not be broken by the application of a pose file.
Because we want the eyes to rotate in opposite directions, the deltaAddDelta value in the left eye is negative. When slaving a rotate channel to a targetGeom or valueParm channel you will usually need to use a deltaAddDelta value of around 10.0 or greater. With a deltaAddDelta value of 1.0 the eyes would rotate in such fine increments that the dial may appear not to be working.
There are a couple of potential problems with the above file that you should be aware of. First, because it uses a targetGeom (morph) channel, if you save a pose using the option to include morphs, the value of the master channel will be remembered in the pose, so applying a pose you saved, to the figure, has the potential to reset the value of this dial.This could be a good thing or a bad thing, depending on the circumstances and what you want. Also third party poses to inject morphs, may reset this channel, or even want to change its dial name and inject deltas into it. These problems are common to all pose files that use the DAZ PBMCC_## channels, not just our Squint pose.
From the above file it should be obvious that we are not limited to squinting the eyes, we can have master dials that make both eyes go side-side, and up-down, and translate two eyes from one dial. I will try to post more on that later, but for the time being why not see you can work out how to do it your self? One tip if you do, try a deltaAddDelta of around 0.001 as a starting point for the translate channels.
To be continued...
lesbentley posted Fri, 04 April 2008 at 8:27 PM
**TIP:**Grouping Dials.
With my last examples "V3_Squint.pz2", if you had the head selected when you applied the pose the "Eyes_Squint" dial should come in at the top of the parameters pallet, but as I said you may need to select another actor then reselect the head before you can see the dial. If some part other than the head was selected when the pose was applied, then the dial will in all likely hood not come in at the top of the parameters pallet, and you will have to hunt through the morph dials to find it. At least that's how it works for me in P6.
In P5 and up, you can assign your dials to a group. This will make them easier to find. To place the Eyes_Squint dial to a group, you can use the file below.
{
//SquintGroup.pz2
version
{
number 5
}
actor head
{
channels
{
groups
{
groupNode Eyes_Move
{
parmNode PBMCC_16
}
}
}
}
figure
{
}
}
NOTES:
**Use the internal name of the channel, in the 'parmNode' line, NOT the dial name.**Once again, if the head is selected when you apply the pose you will have to select some other actor, then reselect the head before you will see the new group. The new group should come in at the top of the parameters pallet, no matter what actor was selected when you applied the pose.
With the above file we are creating the group after the fact, but we could have included the code to create the group in the original V3_Squint.pz2.
!!!IMPORTANT!!!
As mentioned by semidieu in an earlier post, if you inclide code to create a group in your pose, it will overwrite any groupuping that existed previously in that actor, you will loose the old grouping. However Poser will always separate morphs and transforms into separate groups (unless this is overridden by the application of grouping code).
Remember grouping dials only works in P5 or above.
svdl posted Fri, 04 April 2008 at 9:49 PM
Joints are channels, so you can set joint parameters, including spherical falloff zones, using a pose file.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
lesbentley posted Fri, 04 April 2008 at 9:50 PM
**Injecting ERC slaving (part 3).**V3_EyesBoth.pz2
This is a more complex file, only because it contains more channels, but the structure and function of the pz2 below are much the same as the "V3_Squint.pz2". The only significant differences are that it places the master dials in a group, and contains more master and slave channels.
The file contains channels to move the eyes Side-Side, Up-Down, and also to translate the eyes.
{
//V3_EyesBoth.pz2
//For V3 and similar figures.
//Adds dials to the head to move both eyes at once.
version
{
number 3
}
//The section below sets up the initial state of the master targetGeom channels in the head,
//note in particular the use of 'indexes 0' to clear any deltas from the channels.
actor head
{
channels
{
groups
{
groupNode Eyes_Move
{
parmNode PBMCC_11
parmNode PBMCC_12
parmNode PBMCC_13
parmNode PBMCC_14
parmNode PBMCC_15
}
}
targetGeom PBMCC_11
{
name Eyes_Side-Side
initValue 0
hidden 0
forceLimits 1
min -5.500
max 5.500
trackingScale 0.02
keys
{
static 0
k 0 0
}
interpStyleLocked 0
indexes 0
}
targetGeom PBMCC_12
{
name Eyes_Up-Down
initValue 0
hidden 0
forceLimits 1
min -3.300
max 3.300
trackingScale 0.02
keys
{
static 0
k 0 0
}
interpStyleLocked 0
indexes 0
}
targetGeom PBMCC_13
{
name Eyes_xTran
initValue 0
hidden 0
forceLimits 0
min -10000
max 10000
trackingScale 0.02
keys
{
static 0
k 0 0
}
interpStyleLocked 0
indexes 0
}
targetGeom PBMCC_14
{
name Eyes_yTran
initValue 0
hidden 0
forceLimits 0
min -10000
max 10000
trackingScale 0.02
keys
{
static 0
k 0 0
}
interpStyleLocked 0
indexes 0
}
targetGeom PBMCC_15
{
name Eyes_zTran
initValue 0
hidden 0
forceLimits 0
min -10000
max 10000
trackingScale 0.02
keys
{
static 0
k 0 0
}
interpStyleLocked 0
indexes 0
}
}
}
//The section below is used to inject slaving code into the eyes.
actor leftEye
{
channels
{
rotateY yrot
{
valueOpDeltaAdd
Figure
head
PBMCC_11
deltaAddDelta 10.000000
}
rotateX xrot
{
valueOpDeltaAdd
Figure
head
PBMCC_12
deltaAddDelta 10.000000
}
translateX xtran
{
valueOpDeltaAdd
Figure
head
Eyes_xTran
deltaAddDelta 0.0010000
}
translateY ytran
{
valueOpDeltaAdd
Figure
head
Eyes_yTran
deltaAddDelta 0.0010000
}
translateZ ztran
{
valueOpDeltaAdd
Figure
head
Eyes_zTran
deltaAddDelta 0.0010000
}
}
}
actor rightEye
{
channels
{
rotateY yrot
{
valueOpDeltaAdd
Figure
head
PBMCC_11
deltaAddDelta 10.000000
}
rotateX xrot
{
valueOpDeltaAdd
Figure
head
PBMCC_12
deltaAddDelta 10.000000
}
translateX xtran
{
valueOpDeltaAdd
Figure
head
Eyes_xTran
deltaAddDelta -0.0010000
}
translateY ytran
{
valueOpDeltaAdd
Figure
head
Eyes_yTran
deltaAddDelta 0.0010000
}
translateZ ztran
{
valueOpDeltaAdd
Figure
head
Eyes_zTran
deltaAddDelta 0.0010000
}
}
}
//below is the figure section.
figure
{
}
}
NOTES:
All the notes that applied to the "V3_Squint.pz2" and the previous tip on grouping dials, also apply the this file. Note that the 'deltaAddDelta' for the translate channels is a relatively small number '0.0010000', there are two reasons for this. First, a translate channel slaved to a targetGeom (morph) or valueParm (FBM) channel inherently tends to need a smaller 'deltaAddDelta' value than a rotate channel in the same situation. Secondly, because we are moving a small object, the eye, relative to a thin object, the eyelid, we need small increments to get the exact fit. If we were trying to move a car along a road, a much bigger value for 'deltaAddDelta' might be appropriate.
Note that I have forced limits on the master rotate channels, but not on the translate channels. I know that exceeding the limits I have set for the rotations would be silly, so I forced limits for these channels, I don't know how far someone might want to translate the eyes, so I left the limits unforced.
Although this file is called V3EyesBoth.pz2, it should work on just about any figure that uses the PBMCC## channel names.
To be continued...
lesbentley posted Fri, 04 April 2008 at 9:55 PM
Have I managed to confuse you all yet?
**Any questions on what has been covered so far?
**@ svdl,
Thanks for the tip on Joint Parameters.
svdl posted Fri, 04 April 2008 at 9:55 PM
You can use a pose file to run a Python script:
{
version
{
number 6
}
runPythonScript ":runtime:pathscript.py"
}
And you can combine this with all other pz2 tricks.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
lesbentley posted Fri, 04 April 2008 at 10:42 PM
Attached Link: Saving Partial Poses (Tutorial)
** TIP:**Arcadia has a great tutorial on saving partial poses. Check out the link above.
@ svdl,
Thanks for the tip on calling py scripts from a pose file.
lesbentley posted Sat, 05 April 2008 at 11:46 AM
P4_EyesBoth.pz2
The text of this file has been attached above. Save it to a pose folder as "P4_EyesBoth.pz2". That is to say, delete the ".TXT" part of the file extension.
We have seen how we can inject ERC slaving code to move the eyes, into figures that use the DAZ PBMCC_## channels, but we don't necessarily need the PBMCC_## channels, nor do the master channels necessarily need to be in the head. So long as we can find some targetGeom or valueParm channels to subvert to our purposes we can implement the same type of thing.
The file attached above is almost exactly the same as the "V3_EyesBoth.pz2", except it uses targetGeom channels in the head of the P4 Nude Man and Woman. Of course the morphs in these channels will no longer be available. The channels I have used as master channels are:
RoundFace
LongFace
FlatFace
HeartFace
SquareFace
As mentioned previously 'indexes 0' is used to delete the deltas from the channels.
svdl posted Sat, 05 April 2008 at 12:04 PM
You can even create the master channels using a Pose file. Either using a Python script, or from the pose file itself:
{
version
{
number 6
}
createFullBodyMorph EyesSideSide
actor leftEye
{
channels
{
rotateY yRot
{
valueOpDeltaAdd
Figure
BODY
EyesSideSide
deltaAddDelta 90.000
}
}
}
actor rightEye
{
channels
{
rotateY yRot
{
valueOpDeltaAdd
Figure
BODY
EyesSideSide
deltaAddDelta 90.000
}
}
}
}
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
lesbentley posted Sat, 05 April 2008 at 1:37 PM
(I wrote this before seeing svdl's post above, that post furnishes a nice simple example of using 'createFullBodyMorph'. thanks svdl)
In "Injecting ERC slaving (part 2)" I mentioned some potential problems we may run into with the files we have been using to move the eyes. Essentially these boil down to the fact that other poses may try to use the same channels we have used as master channels. It would be nice if we could create new master channels dedicated to our own use. If you have P6 or later you can.
P6 introduced a new statement into Poser Script 'createFullBodyMorph', this statement can create new 'valueParm' (FBM) channels in the BODY actor. For example:
version
{
number 6
}
createFullBodyMorph Eyes_Side-Side
createFullBodyMorph Eyes_Up-Down
figure
{
}
}
The above file will create two new channels in the BODY, "valueParm Eyes_Side-Side" and "valueParm Eyes_Up-Down". Attached at the top of this post is a pz2 file that uses 'createFullBodyMorph' in yet another file to move the eyes.
Not only does this file overcome the potential problems with our other eye move poses, it can also be used on almost any figure, the only requirement is that the figure uses standard actor names for the eyes and BODY, and standard channel names in the eyes. Another nice thing about using 'createFullBodyMorph' is that forces a refresh of the parameters pallet.
The down sides are that it will only work in P6 or above, and it creates the master channels in the BODY, which is not as convenient as the head when it comes to moving the eyes.
If you inspect the file you will notice that there is less code to initialize the master channels. Because these are new channels, that we created, we can be confident that they have the default initial values, so we only need to set those values that we wish to be different from the defaults.
Because the channel type is valueParm, rather than targetGeom, I was able to change the 'trackingScale' in the master channels. This allowed me to use different 'deltaAddDelta' values in the slave channels. You should always consider the trackingScale of the master, and the deltaAddDelta of the slave in conjunction.
I feel that if you have P6, then this is the best of the eye move files, because it is more universal in what figures it can work on, and solves potential problems that the others had.
Poser 6 also introduced PMD files. There is a tutorial on "Poser 6 PMD Injection" at Nerd3D:
http://www.nerd3d.com/modules.php?name=Content&pa=showpage&pid=13
JHoagland posted Sat, 05 April 2008 at 6:02 PM
If it hasn't been said before, it is very important to keep the proper case. "actor hip" is not the same as "Actor hip" or even "actor Hip". If you have the wrong case, will the pose work? Maybe or maybe not.
If it doesn't work, you'll be pulling your hair out wondering what you did wrong.
VanishingPoint... Advanced 3D Modeling Solutions
lesbentley posted Sat, 05 April 2008 at 9:10 PM
Good tip JHoagland!
Another common fault is none matching braces. Each opening brace "{" needs to have a matching closing brace "}". Its easy to slip up and leave a brace out, or add an extra one by mistake. If your pose file does not work, two of the first things to look for are none matching braces and wrong case.
I hope to add a few posts on Delta Injection soon, I'm a bit busy at the moment, so it may take me a few days to get started.
Diogenes posted Sun, 06 April 2008 at 4:45 PM
lesbentley posted Mon, 07 April 2008 at 7:32 PM
Delta Injection (Part 1).
Introduction.
Delta injection is a method of injecting morph targets into a figure from a pose file. The technique seems to have been discovered by Drax back in 2004, below is a link to the thread that started it all, and eventually lead to V3 and all her ilk.
http://www.renderosity.com/mod/forumpro/showthread.php?message_id=394884
An important thing to understand is that delta injection can't create new targetGeom channels, it can only inject morphs into channels that already exist in the figure* (see note at bottom of post).
There are many different ways to proceed in making a Delta Injection Pose (here after referred to as a "DIP"), but most methods involve copying the morph channel (or a subset of the channel) out of a cr2 and pasting it into a pz2 template. In other words a DIP is, in essence, just a targetGeom channel packaged as a pz2.
There are also some methods that involve converting a morphed version of the full base OBJ file into deltas, eg "Pozers Little Helper" available at:
http://home.online.no/~kjellil/Index-AllStuff.htm
*NOTE: Whilst a pose file can't itself create a new targetGeom channel, in P5 and up a pose file can call a Python script that will add a new targetGeom channel, and in P6, PMD files, which can also add channels, can be called from a pose file.
To be continued...
svdl posted Mon, 07 April 2008 at 10:37 PM
There is no way to DELETE a targetGeom channel, other than editing the .cr2. But valueParms can be deleted from a loaded figure/prop in Poser, using PoserPython.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
byAnton posted Mon, 07 April 2008 at 11:10 PM
In Poser 6 and 7, you see a small black arrow next to each morph dial. There is an option to delete the morphs.
-Anton, creator of Apollo Maximus
"Conviction without truth is denial; Denial in the
face of truth is concealment."
byAnton posted Mon, 07 April 2008 at 11:14 PM
BTW: I don't know if this is still true. But at one time an entire scene file could be loaded through the library if renamed from pz3 to pz2. In Poser 4, you can load background images, etc via a pose file. At that time a pose file will support most anything in a pz3. Not sure if the same is still true.
-Anton, creator of Apollo Maximus
"Conviction without truth is denial; Denial in the
face of truth is concealment."
byAnton posted Mon, 07 April 2008 at 11:19 PM
Yes a scene can still be loaded via the library in Poser6. You just have to have any figure in the scene first before clicking the pose.
-Anton, creator of Apollo Maximus
"Conviction without truth is denial; Denial in the
face of truth is concealment."
svdl posted Mon, 07 April 2008 at 11:20 PM
Quote - In Poser 6 and 7, you see a small black arrow next to each morph dial. There is an option to delete the morphs.
True. But that's only possible in the user interface, you can't do it with Python or a pose file.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
svdl posted Mon, 07 April 2008 at 11:31 PM
If you rename a scene to .cr2, you can load it into a completely blank Poser scene.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
byAnton posted Tue, 08 April 2008 at 12:48 AM
Ah yes. That is what I meant. Your right. But hey .. lol. it does turn out the pz2 can hold the data too. Likely why the cr2 info is compatible in pz2. Makes sense. All derivatives of the pz3. I used to have lists somewhere. The mind is a fragile thing. :) Great to have all this in one spot. :)
-Anton, creator of Apollo Maximus
"Conviction without truth is denial; Denial in the
face of truth is concealment."
lesbentley posted Tue, 08 April 2008 at 8:02 AM
Another way to delete a targetGeom channel in the interface is to select the channel in the Hierarchy Editor then hit the keyboard Delete key. This woks from at least P4 up.
You can use a whole pz3 in a pz2 or cr2, but if you load it into an existing scene it may have bad effects on the lights, if lights with the same name exist in both scene and pz3. I would sugest deleting the lights either from the scene or from the pz3 first.
lesbentley posted Tue, 08 April 2008 at 8:19 AM
In this post we will make a custom morph target to use in our delta injection pose.
You will need to have "Use file compression" and "Use external binary morph targets" turned off in your Gneral Preferences.
I'm going to use Posette (P4 Nude Woman) in this example. In Poser, load the 'P4 Nude Woman'(you could use a diffrent figure). Select her head and create a magnet. zTran the Mag by about 0.5. Scale down the Mag Zone to its minimum size (0.1). Move the Mag Zone (by its paramiter dials) untill it just brushes the tip if the nose, try to catch just one vertex so it is pulled out to make a point. The nose should now look something like the picture above.
From the menu bar, Object menu, select 'Spawn Morph Target', name the morph "Point Nose". Delete the magnet. Set the "Point Nose" dial to 1.0 (if this was going to be part of an FBM we would leave the dial at zero). Save the figure back to a Figures pallet as "Z" (for example).
NOTES: We have only moved one vertex in order to keep the file size down in this example, and so that you can see what a delta line to move one vertex looks like. In some later examples we will use a cr2 editor to make the process of working with large files easier, but for now we will use a text editor. When rendered in P6 or above the point on the nose may change shape in an unexpected way. This is caused by 'Smooth polygons' turn this feature off in the head's Properties to see the true shape.
We now have our custom morph. The next step is to make a pz2 template to house the morph. To be continued...
lesbentley posted Tue, 08 April 2008 at 12:02 PM
Making the template & inserting the targetGeom.
Here is a basic template that can be used as a starting point for any pose file, except that the version number may have to be changed depending on what features the pose needs to support. The function of the version number is to generate an error message if the file version is later than the version of Poser trying to open it. I'm not aware that the version number has any other effect, but I may be wrong. The 'figure' block may not be needed, but it does no harm. { //[comment can go here] version { number 3 }
figure
{
}
}
You may like to save the above to disk so you don't have to type it out every time you make a pose file. Next we need to add a block of code for each actor that is going to have a morph injected (in this case just one). Each 'actor' block must also contain a 'channels' block. Below, the Green code is the basic template, the actor block is in White, and the channels block is in Red.
<span style="color:rgb(0,255,0);">{<br></br>//<br></br>version<br></br> {<br></br> number 3<br></br> }</span>
<span style="color:rgb(255,255,255);">actor head<br></br> {</span>
<span style="color:rgb(255,255,255);">}</span>
<span style="color:rgb(0,255,0);">figure<br></br> {<br></br><br></br> }<br></br>}</span>
NOTES:
You might like to make a template that contains all the actor blocks for your figure, with a channels block in each. This is handy if you are going to make pose files that affect a lot of actors. You can delete the unused actors later.
**Next we will put the targetGeom channel in the template.**In a new text editor window, open the "Z.cr2" created as per my last post. Use the editors Search (Find) function to find the string "targetGeom Point Nose". Copy everything, from this selected line down to the closing brace of the channel, just above where the next channel starts, and paste it into the place indicated in the template above. Here is what the code you are pasting should look like (there may be a few more or less lines of code depending on your Poser version):
targetGeom <span style="color:rgb(255,0,0);">Point Nose</span>
{
name Point Nose
initValue 0
hidden 0
forceLimits 1
min -100000
max 100000
trackingScale 0.02
keys
{
static 0
k 0 0
}
interpStyleLocked 0
indexes 1
numbDeltas 3470
deltas
{
d 1514 -5.277533e-006 -0.001445413 0.03142137
}
blendType 0
}
We need to make one edit to the code we pasted. You will remember that we can only inject into a channel that exists in the cr2. The original Posette cr2 contains no channel named "Point Nose", so we need to edit the internal name (in red above) to something that does exist in Posette, for example "RoundFace". Change the first line of the code we pasted to read: "targetGeom RoundFace"
We can leave the 'name' line as "Point Nose", this is the name that will be displayed above the dial in the paramiters pallet.
The complete text of the finished DIP is in the attachment at the top of this post.
Save the file with a descriptive name (eg "P4 PointNose.pz2") to a pose folder. In Poser, Test on Posette to make sure it works.
NOTES:
If you want you can set of 'min, and 'max' limits for the channel (I usually don't):
forceLimits 1
min 0
max 1
Personally I usually paste the whole channel then just save the pz2 and use that. Previous pose files, or user actions may have changed some of the values. I like to be sure all the paramiters are set the way I want them. DAZ use a more minimilist aproach, a DAZ injection the channel would be cut down to this: targetGeom RoundFace { name Point Nose interpStyleLocked 0 indexes 1 numbDeltas 3470 deltas { d 1514 -5.277533e-006 -0.001445413 0.03142137 } }
DAZ use a seperate Unhide pose to make sure the channel is not hidden. Im not sure why DAZ use an Unhide pose, as soon as Poser "sees" deltas in a a hidden channel (eg deltas are injected into the channel), it will unhide the channel, changing its flag to 'hidden 0'. So the DAZ Unhide poses look like a waste of space to me! Usually both the pz2s to inject the deltas and the pz2s to unhide the channels are "called" from another pz2 via 'readScript' (I will try to say something about readScript later). The absolute minimum you could use to inject deltas would be this:
targetGeom SomeName
{
deltas
{
[delta lines here]
}
}
Next we will look at Delta injection in conjunction with FBMs. To be continued...
Jules53757 posted Tue, 08 April 2008 at 12:14 PM
IMO the unhide pose came with P6. Before a not existing hidden statement was interpreted as hidden 0. With P6 it is interpreted as hidden 1 so, may be DAZ wants to make sure that there is a hidden statement.
Ulli
"Never argue with an idiot. They drag you down to their level and beat you with experience!"
lesbentley posted Tue, 08 April 2008 at 12:56 PM
CORRECTION
I said that the DAZ Unhide poses looked like a waist of space. I was wrong. It can be very usefull to be able to hide some dials in order to more easily see the ones you want to use. As dials can be hidden by a Pose, you need another pose to unhide them. I just don't see why you need to call a seperate Unhide pose when you inject the morph! If you want you can use 'hidden 0' in the delata injection pose (I usually do), but even without the 'hidden 0', injecting deltas should unhide the pose in all Poser versions to date.
lesbentley posted Wed, 09 April 2008 at 4:54 PM
Attached Link: A head rotation question
** Injecting an IK chain.**By way of an aside, whilst I am trying to work up the energy for the next instalment on delta injection. Did you know that you can use a pose file to inject IK chains. See the link above. Also at the same link is an example of using a pose file to move the 'endPoint' of the head, for better compatibility with 'Point At'.
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."
lesbentley posted Fri, 11 April 2008 at 10:30 PM
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
**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
**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
**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
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
lesbentley posted Thu, 17 April 2008 at 2:36 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
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
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
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
@ 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.
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
**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???
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?
lesbentley posted Sun, 20 April 2008 at 1:39 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
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
}
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
lesbentley posted Sun, 20 April 2008 at 6:24 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
lesbentley posted 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
lesbentley posted Mon, 21 April 2008 at 12:59 PM
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
lesbentley posted Thu, 24 April 2008 at 1:41 PM
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
@ 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
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
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
@ 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
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
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
lesbentley posted Fri, 02 May 2008 at 7:06 PM
**Hidden (Part 3).**Doors and 'hidden'.
When a pp2 (prop) or cr2 (figure) contains a door, it is usual to hide all the rotation and translation dials, except the one that opens the door, and to force limits where appropriate to stop the door moving in undesirable ways. This is usually done by editing the pp2 or cr2 in question, but it can also be done in the Poser interface via the application of a pose file.
Sometimes you may download a freebie where the door has not been set up correctly. In that case you can try this pose file on it, rather than text editing the original file. If it works as desired you can save the item back to a pallet.
In the file below, it is assumed that the 'yrot' channel opens the door, as that is the most usual case, but it may not always be so. Especially if the "door" is a hatch, you may have to edit the pose as appropriate. It is also assumed that that the door is in the correct position when all its translations and rotations are set to zero.
{
//DoorFix.cm2
version
{
number 5
}
actor $CURRENT
{
channels
{
scale scale
{
hidden 1
}
scaleX xScale
{
hidden 1
}
scaleY yScale
{
hidden 1
}
scaleZ zScale
{
hidden 1
}
rotateY yrot
{
name <span style="color:rgb(255,0,0);">Open</span>
hidden <span style="color:rgb(255,0,0);">0</span>
forceLimits <span style="color:rgb(255,0,0);">1</span>
min <span style="color:rgb(255,0,0);">-360.000</span>
max <span style="color:rgb(255,0,0);">360.000</span>
}
rotateZ zrot
{
initValue 0
hidden 1
forceLimits 1
min 0
max 0
}
rotateX xrot
{
initValue 0
hidden 1
forceLimits 1
min 0
max 0
}
translateX xtran
{
initValue 0
hidden 1
forceLimits 1
min 0
max 0
}
translateY ytran
{
initValue 0
hidden 1
forceLimits 1
min 0
max 0
}
translateZ ztran
{
initValue 0
hidden 1
forceLimits 1
min 0
max 0
}
}
}
}
!!!CAUTION!!! You should use this file in a scene that only contains the prop or cr2 you want to modify. Then save the modified file back to a pallet. If you use it in a WIP, and it has unexpected results, or you apply the pose to the wrong element, if you have not first saved the scene to a pz3, you may find it hard to put things back the way they were. You can edit the 'min' and 'max' lines in the 'yrot' channel to limit how far the door will open. For example, to only allow the door to open to -90º, you would use:
rotateY yrot
{
name Open
hidden 0
forceLimits <span style="color:rgb(255,0,0);">1</span>
min <span style="color:rgb(255,0,0);">-90.000</span>
max <span style="color:rgb(255,0,0);">0</span>
}
NOTES:
You will probably have to select some other element in the scene, then reselect the door to refresh the pallet and hide the dials. Because the above file uses 'actor $CURRENT' it will only work in P5 or above.
The scale dials have been hidden, but no limits have been set for them as I do not think this is really necessary. If you do want to set limits for the scale channels, remember that the default value for a scale channel is "1", not "0".
Because you may want to use the file when there is no figure in the scene, it is best to save it to a camera folder, with a cm2 file extension.
alizea posted Sun, 04 May 2008 at 1:14 PM
Thank you for testing the INJ script ,I'll ask on Python forum and I'll bring here the answer ( if any !)
Alice's and
GND4's Tailor !
Check my free clothing
fits : www.alizea3d.com
Photopium posted Sun, 04 May 2008 at 3:51 PM
Quote - **
**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!.
Good news, you CAN delete nodes in the Graph Editor! Drag/highlight/select a chunk of the graph window over the points you wish to delete. When you have those points selected, hit delete and they are gone. Hope this helps!
-WTB
lesbentley posted Tue, 06 May 2008 at 4:37 PM
@ William,
Thanks for the tip William. I never realised that you could do that. Serves me right for not reading the manual.
@ alizea,
Thanks alizea. Please keep us posted. This issue seems quite important to my mind.
lesbentley posted Sun, 11 May 2008 at 8:02 AM
**REM Poses.**REMove Morph Deltas.
In the posts on Delta Injection we have seen how to inject deltas into a targetGeom (morph) channel. Deltas typically account for a very large amount of the code in a figure, so removing deltas from unused morph channels can be a good idea. I should really have put this post immediately after the Delta Injection stuff, but somehow I forgot. There is some latitude as to exactly what should or should not go into a REM pose. These are just my thoughts on the subject, arrived at after making REMs for my own use, I have never distributed a delta injection/REM package, and claim no particular expertise in this field.
The job of removing deltas from a targetGeom channel is done by using 'indexes 0'. The file below will remove the deltas from the "PBMCC_01" channel in the head:
{
version
{
number 4.01
}
actor head
{
channels
{
targetGeom PBMCC_01
{
indexes 0
}
}
}
}
Usually we want the REM pose to do more than just remove the deltas. Below is a REM pose that also resets the dial name, and hides the dial from parameters pallet: { version { number 4.01 } actor head { channels { targetGeom RoundFace { name - hidden 1 indexes 0 numbDeltas 0 } } } }
Most REM files that I have seen include the line "numbDeltas 0". I can't see that it serves any useful purpose in a REM pose, but I may be mistaken on this point. Perhaps it is best to include this line, just to be on the safe side. It's probably debatable exactly what should or should not be included in a REM pose. DAZ seem to leave out the 'hidden 1' line, but use a pz2 containing readScript to call both REM and Hide poses. To me this seems an unnecessarily complicated way to do things.
I think a case can be made for zeroing the 'k' line value in the REM pose. This should not really be necessary as the delta injection pose should, in my opinion, set this value as appropriate (to zero or one, depending on circumstances), but not all do. An even stronger case can be made for setting the 'initValue' to zero, as the figure may have been Memorized at some point, and if the morph deltas are being removed, then the Memorized value is probably inappropriate to any new morph injected in this channel.
The dial name is usually set to "name -". An alternative is to set the internal name as the dial name, so that if the dial should be unhidden for any reason, you can see which channel it belongs to, however this can be extra work.
Where targetGeom (morph) channels are slaved to valueParm (FBM) channels in the BODY, another question that is open to debate is whether the REM pose should reset any parameters in the valueParm channel, and if so which ones. I tend to think that the 'name', 'initValue', and 'k' lines should be reset in the valueParm.
So my current thinking is that a REM should look like this:
{
version
{
number 4.01
}
actor BODY
{
channels
{
valueParm PBMCC_01
{
name PBMCC_01
initValue 0
keys
{
k 0 0
}
}
}
}
actor neck
{
channels
{
targetGeom PBMCC_01
{
name PBMCC_01
initValue 0
hidden 1
keys
{
k 0 0
}
indexes 0
numbDeltas 0
}
}
}
}
Some people may think that the above is a bit over the top and unnecessary, perhaps they are right. Below is a pz2 produced by svdl's "SpawnCharacterP6.py". Note that it hides the valueParm channel. As hiding the channel reduces some of the clutter in the parameters pallet, it may be a good idea, but some future injection may forget to unhide the channel, this is probably not very likely, but is something to be considered. The file also sets 'static 0' (animating off) in the valueParm, in my opinion this is very unlikely to be needed. I'm not trying to knock svdl's REM poses, I think "SpawnCharacterP6.py" produces very good and well thought out poses, I'm just pointing out some things to be considered.
{
version
{
number 4.01
}
actor BODY
{
channels
{
valueParm PBMCC_01
{
name -
hidden 1
keys
{
static 0
k 0 0
}
}
}
}
actor head
{
channels
{
targetGeom PBMCC_01
{
name -
hidden 1
indexes 0
numbDeltas 0
}
}
}
}
In the end, what you do or don't put into a REM pose is up to you. As I said at the beginning, I am no particular expert in REM poses, and what I have said in this post is meant as food for thought, not dogma. I would be interested to hear other people's thoughts on this subject.
lesbentley posted Sun, 11 May 2008 at 10:46 AM
**Version Numbers.**The first block of code in any Poser file is the version block. This tells Poser which version the file was exported from, or created for.
{
version
{
number 4.01
}
}
If you try to use a a Poser library file that has a later version number than the version of Poser that is trying to open it, then Poser will generate a message: "The file has a newer version number
than expected. Poser will attempt to
read it anyway"
You then have to press an "OK" button (there is no "Cancel" button). As far as I am aware, generating this message is the only effect of the version number.
You should use the lowest version number in the file that you are confidant is consistent with all the code in the file working as desired. I have never owned P3, but I know that "normal" poses to set joint rotations or translations work in P3, so for those type of poses I use a version number of 'number 3'. 'actor $CURRENT' was introduced in P5, so any file that uses that should have a version number of at least 5. The 'shaderTree' was also introduced in P5, as an addition to the 'material' blocks, so any file thats main purpose is to set shaderTree nodes should have a version number of at least 5. However if the shaderTree is not an essential part of the function of the file, you may want to use an earlier version number to avoid the pop up message. P6 introduced these:
injectPMDFileMorphs
createFullBodyMorph
attachFBMdial
So any file that uses these should have a version number of at least 6. There were some other things introduced in P6, but as they are not normally essential to the operation of pose files, you do not usually need to take them into consideration when deciding which version number to use.
P7 introduced its own additions to Poser script, but as I don't have P7, I can't give you any information on them.
All the examples I have posted in this thread were tested in P6. Many will work in earlier versions. I hope that Poser is, and will remain, backwards compatible with all earlier Poser script, and that the examples in this thread will continue to work in P7, P7 Pro, and future versions. But there is no guarantee that Poser will continue to implement everything the same way in future versions. "Pose Overflow" mentioned in previous posts is an example of something that used to work in P4, but no longer works in P6.
DarkEdge posted Sun, 11 May 2008 at 10:56 AM
Les, thank you so muuuuch for sharing this text book of code.
For me personally, I hate code because it baffles me. But all of this is just awesome man!
nruddock posted Sun, 11 May 2008 at 11:13 AM
Quote - I would be interested to hear other people's thoughts on this subject.
Making sure everything is explicitly set to a known (and hopefully consistent) state is a good programming practice.
lesbentley posted Mon, 12 May 2008 at 6:22 PM
**Disable Slaving.**This may be a bit of an obscure topic, but someone may find a use for it.
Sometimes you may want to disable slaving for some particular channel. In the slaving code the value in the 'deltaAddDelta' line determines the strength of the slaving, so setting this value to zero effectively turns the slaving off. We can do this if there is only one block of slaving code in the channel, or if the block of slaving code that we want to disable is the last block in the channel.
Method A:
{
version
{
number 4.03
}
actor hip
{
channels
{
targetGeom heroineHip
{
deltaAddDelta 0.000000
}
}
}
}
The above pz2 file will set the 'deltaAddDelta' value to zero for the last slaving code block in the channel, thus effectively disabling the slaving. If the channel is only slaved to one master, all is fine and dandy, but sometimes a channel may have more than one master. When the channel has more than one master, and the slaving that we want to disable is NOT in the last block of slaving code, we need to find another trick. If we can find an unused channel to subvert to our purpose, we can do it like this.
Say for example we have a morph channel in the head that uses the dial name "MyMorph", which is slaved to a FBM in the BODY which also uses the dial name "MyMorph", both these channels use the internal name "PBMCC_01".
Say we have a spar channel in the BODY with the internal name of "PBMCC_07". Here is the pz2 we could use to disable the slaving.
Method B:
{
version
{
number 4.03
}
actor BODY
{
channels
{
# Slave the PBMCC_07 channel to the MyMorph dial name (PBMCC_01), using 'valueOpMinus'.
valueParm PBMCC_07
{
name <span style="color:rgb(255,0,0);">-MyMorph</span>
initValue 0
hidden <span style="color:rgb(255,0,0);">1</span>
forceLimits 0
min -100000
max 100000
trackingScale 0.004
keys
{
static 0
k 0 0
}
interpStyleLocked 0
<span style="color:rgb(255,0,0);">valueOpMinus</span>
Figure
BODY
<span style="color:rgb(255,0,0);">MyMorph</span>
}
}
}
actor head
{
channels
{
# Slave the PBMCC_01 in the head to the dial name "-MyMorph" (PBMCC_07) in the BODY.
# The deltaAddDelta value needs to be the same as that which you are trying to cancel out (MyMorph).
targetGeom PBMCC_01
{
valueOpDeltaAdd
Figure
BODY
<span style="color:rgb(255,0,0);">-MyMorph</span>
deltaAddDelta 1.000
}
}
}
}
The morph in the head (or where ever) is slaved to two valueParm channels in the BODY. Because the value in "-MyMorph" channel is the exact inverse of the value in the "MyMorph" channel (in the BODY), and the same deltaAddDelta value has been used in both slaving blocks in the head, the tow sets of slaving cancel each other out. To finish up, here is a way to temporarily disable all slaving for a channel, even future slaving that has not yet been applied. One nice feature of this method is that it gives you a dial that allows you to turn the slaving on or off.
Method C:
{
version
{
number 4.03
}
actor BODY
{
channels
{
# First we set up the master valueParm channel the way we want it.
valueParm PBMCC_07
{
name <span style="color:rgb(255,0,0);">On-Off</span>
initValue 0
hidden 0
forceLimits <span style="color:rgb(255,0,0);">1</span>
min <span style="color:rgb(255,0,0);">0</span>
max <span style="color:rgb(255,0,0);">1</span>
trackingScale <span style="color:rgb(255,0,0);">1</span>
keys
{
static 0
k 0 0
}
interpStyleLocked 0
}
}
}
actor head
{
channels
{
# Now we slave the channel who's slaving we want to disable to the
# master channel, using 'valueOpTimes'.
targetGeom PBMCC_01
{
<span style="color:rgb(255,0,0);">valueOpTimes</span>
Figure
BODY
<span style="color:rgb(255,0,0);">On-Off</span>
}
}
}
}
NOTES:
What the 'valueOpTimes' operator does it to multiply the 'k' line value in the slave channel by the 'k' line value in the master channel. When the value in the master channel is zero, the slave channel will always be at an effective value of zero, irrespective of what value is set on its own dial, or of any slaving it has to any other other master channels. When the master channel is set at a value of one, the full effect of its own dial, and any other channels it is slaved to will be seen. In this case the "On-Off" channel has been limited to the value of either 1 or 0 by the use of 'forceLimits 1', 'min' and 'max' and the 'trackingScale'. Besides the normal 'valueOpDeltaAdd', and the 'valueOpMinus', and 'valueOpTimes' operators that we have seen in this post, there also exist 'valueOpPlus', 'valueOpDivideBy', and 'valueOpDivideInto' operators. The value operators that use division can cause divide by zero errors, so you should familiarize your self with how they work before experimenting with them.
For in-depth information on ERC, see "How to Write ERC Code" on VK's (a.k.a. atlantis23) site. He has downloadable tutorials on all aspects of ERC. For specific info on the different value operators, see "A different approach to ERC code" on VK's site.
I'll try to come up with something simple and useful for my next post.
lesbentley posted Tue, 13 May 2008 at 7:21 PM
**Animating off/on ('static').**You will be aware that both lights and cameras have an "Animating" check-box in their Properties tab. The state of this check-box determines whether or not the item can be animated in a Poser animation. The "Animating" check box sets the 'static' switch in the channels of the item to either "0" = animating, or "1" = none-animating.
Every Poser channel, by default, contains a 'static' line in the 'keys' section of the channel.
keys
{
<span style="color:rgb(255,0,0);">static 0</span>
k 0 0
}
So although the Poser interface only provides a way to change this switch for lights and cameras, a pose file can set the 'static' status for any channel, in anything. OK, interesting, but what use is it? One use is in Walk Cycles, where we want the figure to walk either above or below the level of the Poser GROUND plain. First I'll show you the pz2 file, here it is:
{
//static 1-Bod y.pz2
version
{
number 4.03
}
actor BODY
{
channels
{
translateY ytran
{
keys
{
static 1
}
}
}
}
}
The pose to turn 'static' off is the same as above, except it uses 'static 0'. Now load a Walk Path and run a Walk Cycle on a figure. In frame #1, yTran the body, then run the animation. The figure immediately drops back to the ground in frame #2. Now, in any frame of the animation apply the above pose file, and yTran the BODY. The figure (of more precisely the BODY actor) will maintain this altitude throughout the animation. You can adjust the yTran of the BODY in any frame and it will remain constant throughout the animation.
Of course there are other ways you could get the figure walking at different altitudes. You could use the Graph Editor, or parent the figure to an invisible prop. The parenting to prop method is particularly flexible, as it even allows the figure to walk upside-down, but for a quick, one click fix, 'static 1' can't be beat.
Note that you need to apply the correction to yTran after you have applied the Walk Cycle, and that applying another Walk Cycle will drop the figure to the ground again.
NOTES:
When 'static' is set on, Poser stores the value you set for the channel in the line 'staticValue' which will be created in the channel when you turn 'static' on. This value will be preserved in the current session, so if you turn static off, then turn it back on, the value will be used again. However if you save the scene with static turned off the 'staticValue' line will be stripped out of the file. This might be a good time to point out that the first number in the 'k' line of the 'keys' section is the frame number, 'k 0 ?' is the first frame of an animation, this is (rather confusingly) represented as Frame 1 in the Animation pallet, 'k 1 ?' is the second frame in the animation, 'k 24 ?' is the 25 frame in the animation, etc.
Nance posted Wed, 09 July 2008 at 10:10 PM
[bookmarking while slapping forehead]
Gees! How'd I miss this one until NOW!?!?
Wonderful collection of work Les. Thanks!
Conniekat8 posted Fri, 01 August 2008 at 9:09 PM
I'm still digesting all the cool technical info in this thread!
A question on ERC's - I see that ERC info can be stored in the FBM level.
Does that mean that I can take thios section out of the cr2, and make it into a PZ2, so that if I need to reload the morphs themselves, I can just inject the ERC info back in? Like in case of touching up morph geometry and then loading it back in (Via dimension3D's add morph tool).
This is asuming that the morph names didn't change.
Hi, my namez: "NO, Bad Kitteh, NO!" Whaz
yurs?
BadKittehCo
Store BadKittehCo Freebies
and product support
Tiny posted Sat, 02 August 2008 at 11:15 AM
Great thread! I'm very glad I found this (finally).
I'm trying to figure out how to set and pass variables between cr2 - pz2 and pz2 - pz2 files. Is it doable?
LostinSpaceman posted Sat, 02 August 2008 at 12:52 PM
Well if you don't want to junk up your runtime with all your LARGE PZ3 files renamed and placed in the character or props directory, you can create prop shells that will load your PZ3's from outside the runtime. This also keeps your runtimes slim and trim instead of bloating them with PZ3 files renamed to CR2 or PP2.
Prop to Call PZ3
{
version
{
number 4.0
}
readScript ":Runtime:Libraries:Scenes:Room.pz3"
}
Outside runtime:
{
version
{
number 4.0
}
readScript "D:ScenesRoom.pz3"
}
LostinSpaceman posted Sat, 02 August 2008 at 1:00 PM
Here's how I make PMD INJection pose files that load the morphs and group them all at once. First I make the Pose file that groups the dials:
Quote -
{
version
{
number 4
} actor head:1
{
channels
{
groups
{
groupNode Transform
{
collapsed 1
parmNode taper
parmNode scale
parmNode xScale
parmNode yScale
parmNode zScale
parmNode yrot
parmNode zrot
parmNode xrot
}
groupNode Morph
{
groupNode Brows
{
collapsed 1
parmNode RBrowDown
parmNode LBrowDown
parmNode RBrowUp
parmNode LBrowUp
parmNode Worry Right
parmNode Worry Left
}
groupNode Eyes
{
collapsed 1
parmNode Blink Right
parmNode Blink Left
parmNode Eyes Natural
}
groupNode Head
{
collapsed 1
parmNode Jaw Slim
parmNode Chin Slim
}
groupNode MatrixWorkz
{
groupNode Ears
{
collapsed 1
parmNode Ears Out
parmNode Ears Up
parmNode Ears Orc
parmNode Ear Lobes Low
parmNode Elf Ears
}
groupNode Brow Expressions
{
collapsed 1
parmNode Brow Fierce
parmNode Brow Furrow
}
groupNode Cheeks
{
collapsed 1
parmNode Cheeks Out
parmNode Chin Weak
parmNode Dimple Cheek
}
groupNode Face Shaping
{
collapsed 1
parmNode Chin Square
parmNode Cleft Chin
parmNode Head Chubby
parmNode Head Slim
parmNode Jaw Narrow
parmNode Nose Narrow
}
}
groupNode Mouth
{
collapsed 1
groupNode Lips
{
collapsed 1
parmNode OpenLips
parmNode Lips 1
parmNode Lips 2
parmNode Lips Fuller
}
groupNode Phonemes
{
collapsed 1
parmNode Mouth F
parmNode Tongue L
parmNode Mouth M
parmNode Mouth O
parmNode Tongue T
}
parmNode Frown
parmNode Raise Mouth
parmNode Smile 1
parmNode Smile 2
parmNode Snarl left
parmNode Snarl right
}
groupNode Nose
{
collapsed 1
parmNode Nose Beaked
parmNode Nose Slim
parmNode Nose Wide
}
}
}
}
Then I make the Pose that loads the morphs and calls the dial group pose:
Quote -
{
version
{
number 4
}
injectPMDFileMorphs :runtime:!MatrixWorkz:Centaur:MWCentaur.pmd
readScript runtime:!MatrixWorkz:Centaur:HeadDials.pz2 }
lesbentley posted Sat, 27 December 2008 at 5:50 AM
@Conniekat8
Quote - I'm still digesting all the cool technical info in this thread!
A question on ERC's - I see that ERC info can be stored in the FBM level.
Does that mean that I can take this section out of the cr2, and make it into a PZ2, so that if I need to reload the morphs themselves, I can just inject the ERC info back in? Like in case of touching up morph geometry and then loading it back in (Via dimension3D's add morph tool).
This is asuming that the morph names didn't change.
I've been off line for some months, and only just saw this post today. I'm not sure I understand exactly what you mean when you say "this section".
An FBM has two parts, a master valueParm (FBM) channel in the BODY actor, and the various individual targetGeom (morph) channels in various body parts that are slaved to the master. If you are using a figure that has spair targetGeom and valueParm channels, such as the DAZ figures that have the PBMCC channels, you can inject any content you like into these channels at any time by using an appropriate pz2. You can inject a diffrent set of deltas (deltas=the morph itself), diffrent dial settings, diffrent limits, add slaving code to a channel, what ever you like. So yes, can store any or all the content of targetGeom and valueParm channels outside of the cr2, in pz2 files.
In the case where spair targetGeom or valueParm channels don't exist in the cr2, the situation is more complicated. In P6 and above you can use "createFullBodyMorph" in a pz2 to create a new valueParm channel. You could then add a normal pose section to to change any of the values in the valueParm channel if necessary. You can add new targetGeom channels with a PMD file called from the pz2. See the tutorial at Nerd3D for details on PMD files. You could also use a python script to create the new targetGeom channels, but it may need to be a two step process, as I'm not sure you can inject new deltas or other date from the same pz2 that calls the python script to create the channel.
@Tiny
Quote - I'm trying to figure out how to set and pass variables between cr2 - pz2 and pz2 - pz2 files. Is it doable?
Sorry I don't know how to do that.
lesbentley posted Sat, 27 December 2008 at 7:45 AM
Geometry InjectionInjection new geometry into props.
A cm2 (Camera) file can be used to inject new geometry into a prop. A pz2 can also be used, but in that case there must be a figure in the scene. Given that restriction, it's usually best to use a cm2 so the file will work even if no figure is in the scene. Here is an example of a cm2 file that will replace the geometry of a Poser box primitive item with the geometry from a Poser cone primitive. Load a box primitive and apply the pose. The box must be named "box_1", that is to say it must be the first instance of the box prop loaded in the scene. Note that the box is addressed as "actor" not "prop".
{
//box2cone.cm2
version
{
number 3.0
}
actor box_1
{
storageOffset 0 0.3487 0
objFileGeom 0 0 :Runtime:Geometries:props:cone.obj
}
}
Instead of the 'objFileGeom' statement, we can also use a 'geomCustom' statement so that the geometry is carried within the cm2 file itself, instead of having to reference an external obj file. The file below loads a square geometry into the box_1 prop. { //box2square.cm2 version { number 3.0 } actor box_1 { geomCustom { numbVerts 8 numbTVerts 4 numbTSets 8 numbElems 2 numbSets 8 v -0.050000 0.000000 0.000000 v 0.050000 0.000000 0.000000 v 0.050000 0.100000 0.000000 v -0.050000 0.100000 0.000000 v -0.050000 0.000000 0.000000 v 0.050000 0.000000 0.000000 v 0.050000 0.100000 0.000000 v -0.050000 0.100000 0.000000 vt 0.000000 0.000000 vt 0.000000 1.000000 vt 1.000000 0.000000 vt 1.000000 1.000000 usemtl Preview s 0 g square f 1/1 2/3 3/4 4/2 f 8/2 7/4 6/3 5/1 } } }
EnglishBob posted Tue, 06 January 2009 at 8:03 AM
Welcome back on the Interwebz, Les. It hasn't been the same without you. :-)
momodot posted Tue, 06 January 2009 at 12:11 PM
Is there a way to unclutter the body part selection pull-down with a .pz2 by for instance hiding the fingers and toes and maybe eyes from that list but not disabling them from selection by tool?
I have not figured out DAZ Studio but I sure like the schematic interface for posing body parts indirectly... it is a drawing of a humaniod figure and basic posing can be done by mousing over that rather than with tools in the preview window. I also loved that old Poser 5 script that created a GUI that was similar to the old Poser 2 interface... I REALLY liked the Poser 2 interface over the subsequent ones... less "artsy" and very easy to use while occupying very little screen space. The script GUI was incomplete but I used it with Poser 5 for years. Funny how the script interface and script library alternatives work better than the Poser UI. Really I am commited to Poser vs. d/s but wow I don't love the GUI. Tools like V4 Xara and UMM and Pose Magic and Bagginsbill's shader controler make so much more sense... it is just too bad they have to be done with control props and sometimes confusing pose files instead of being wired into the GUI!
svdl posted Wed, 07 January 2009 at 2:34 AM
Yes, there is.
This pose will hide the hip of the current figure from all dropdowns, but you can still select using the Hierarchy Editor or clicking in the document window:
{<br></br>
version<br></br>
{<br></br>
number 6<br></br>
}<br></br>
actor hip<br></br>
{<br></br>
hidden 1<br></br>
}<br></br>
}<br></br>
And "hidden 0" will bring the actor back on the menu, of course.
As you can see, I did not include a number in the pose file. Don't need one in this case, it'll just work on the selected figure.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
momodot posted Wed, 07 January 2009 at 9:25 AM
Simple. Thank you.
lesbentley posted Thu, 08 January 2009 at 7:08 PM
One small correction to what svdl said. If you apply that pose you will NOT be able to select the hip by clicking with the mouse in the document window. Once some other body part has been selected, the only way to select the hip will be via the Hierarchy Editor. When the hip is selected (is the active element) you will be able to manipulate it as normal with the mouse, but as soon as you select some other part you are back to needing to use the Hierarchy Editor to select the hip. At least that's the way it works for me.
svdl posted Thu, 08 January 2009 at 7:18 PM
Right-clicking in the document window works - in Poser 7. Haven't tested P6 or earlier.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
CardinalBiggles posted Fri, 09 January 2009 at 7:53 AM
Thanks for all the info!
Bookmarked.
IsaoShi posted Fri, 13 March 2009 at 8:41 AM
Botheration!
Why didn't I find this thread 6 months ago? It would have saved me so much time.
...mumble grumble...
But thank you lesbentley, svdl and all for some great tips.
"If I were a shadow, I know I wouldn't like to be half of
what I should be."
Mr Otsuka, the old black tomcat in Kafka on the Shore (Haruki
Murakami)
TrekkieGrrrl posted Fri, 13 March 2009 at 5:27 PM
This is an absolutely AWESOME thread! WHY isn't that stickied a long time ago?!
FREEBIES! | My Gallery | My Store | My FB | Tumblr |
You just can't put the words "Poserites" and "happy" in the same sentence - didn't you know that? LaurieA
Using Poser since 2002. Currently at Version 11.1 - Win 10.
vholf posted Fri, 13 March 2009 at 8:18 PM
bookmarked
Great stuff, thanks.
cmcc posted Sat, 14 March 2009 at 7:11 PM
Attached Link: http://artcomp1.tripod .com
i was wondering if u could fit python scripting in here. thanx.patorak posted Sun, 15 March 2009 at 6:45 PM
Bookmarked
Excellent resource. Thanks lesbently.
albertdelfosse posted Fri, 27 March 2009 at 10:21 PM
great thread
wolfie posted Tue, 15 June 2010 at 2:57 PM
Ping. Thought I would resurect a wonderful thread.
cmcc posted Wed, 16 June 2010 at 10:32 PM
there's probably an easier way to do this but i have found this to be helpful. let's say ur building a scene or an animation and you want to add another pose to a character from the pose library, but ur character has moved. when u add the pose he moves back to the zero position and rotation. when u move your characers to make a new scene i find it is a good idea to move everything to a new keyframe. then when u give a character a new pose just go to his hip and press the arrow to get the different hip prameters. Encircle with the cursor any hip parameters u want to keep from the first frame (probably xtran, ytran, and ztran (maybe y rotate) and drag them to your new keyframe and the position of your character will be restored with the new pose.
Klebnor posted Thu, 17 June 2010 at 6:55 AM
Regarding the last post, can someone point out the part of the pose file to remove in order to stop a pose from moving the figure as cmcc described when the pose is applied? It would seem that the pose must have some explicit or relative transition information for x, y and z which is being applied and could be deleted from the file to leave the character where it is while applying the pose.
I would like to know this so I can edit some unruly poses.
Klebnor
Lotus 123 ~ S-Render ~ OS/2 WARP ~ IBM 8088 / 4.77 Mhz ~ Hercules Ultima graphics, Hitachi 10 MB HDD, 64K RAM, 12 in diagonal CRT Monitor (16 colors / 60 Hz refresh rate), 240 Watt PS, Dual 1.44 MB Floppies, 2 button mouse input device. Beige horizontal case. I don't display my unit.
Boni posted Tue, 21 July 2015 at 10:49 PM
Bump. This needs to be revisited.
Boni
"Be Hero to Yourself" -- Peter Tork
duanemoody posted Fri, 24 July 2015 at 6:37 PM
You can use a pose file to run a Python script:
{
version
{
number 6
}runPythonScript ":runtime:pathscript.py"
}And you can combine this with all other pz2 tricks.
runPythonScriptEx apparently allows you to pass an argument to the script: runPythonScriptEx "runtime:path:to:script.py"myargument
where in the script, sys.argv[1] == 'myargument'
EldritchCellar posted Fri, 24 July 2015 at 7:47 PM
Mmm, yeah it's a good thread Boni. A lot of really useful stuff in there, one of the strong points of Poser's file system is all of the deep user magic tricks that are possible.
This thread is also is also very good, it's a little more singular goal focused though.
http://www.renderosity.com/mod/forumpro/?thread_id=2810484
W10 Pro, HP Envy X360 Laptop, Intel Core i7-10510U, NVIDIA GeForce MX250, Intel UHD, 16 GB DDR4-2400 SDRAM, 1 TB PCIe NVMe M.2 SSD
Mudbox 2022, Adobe PS CC, Poser Pro 11.3, Blender 2.9, Wings3D 2.2.5
My Freestuff and Gallery at ShareCG