Forum: Poser - OFFICIAL


Subject: How to make cr2 refernce external prop (pp2) file?

muralist opened this issue on May 18, 2006 ยท 6 posts


lesbentley posted Fri, 19 May 2006 at 12:06 PM

If you save a cr2 (figure) with a prop parented to it, then in effect the pp2 (prop) file is incorporated into the cr2, so the geometry reffrence and materials settings for the prop are incorperaded into the cr2 as they were when the cr2 was saved. The mesh groupes ("g") and the material definitions ("usemtl") are in the external obj file, but the material settings (color, texture map, etc) are in the cr2 file. You could use a MAT pose on the figures to change the materials of the props, but this does not seem to be exactly what you want. I can think of no easy way to do what you want, the only way I can think of that will come close to what you are asking for is to load the prop via "readScript" call from within the cr2. This will involve hacking the cr2 files in a text editor (or a cr2 editor). With this method the sword prop will need to be a "smart prop" so that it will automaticly load in the right position relitive to the hand. If the sword is not already a smart prop, parent it to the hand then save it back to a props pallet (don't use "Select Subset"), you will be prompted to save it as a smart prop, do so. Delete the prop from the scene. Resave the figure to a pallet. Open the resulting cr2 in a text editor. Move to the end of the file, just above the closing brace "}", add a readScript statement to load the sword prop, eg:

   readScript "Runtime:Libraries:Props:Prop Types:ZX.pp2"

When the cr2 loads it will now load the pp2 file from disk, and incorporate any modifications made to that pp2. There are limitations to the method, the biggest one is probably that if you save this new figure back to a pallet from the Poser interface the readscript line will have been stripped out, and the text from the pp2 added in its place, thus you will be back to square one. Also, this method may not work with a two handed sword where the sword is parented to one hand and the other hand is parented to the sword (I haven't tried that). A variation on the above method, and perhaps a better idea, is to leave most of the pp2 code in the cr2, delete the material section from the pp2 code, and replace it with a read script statement to load the material from an external file, eg: ---snippet--- interpStyleLocked 0 staticValue 0 } } endPoint 0 0.1 0 origin 0 0 0 orientation 0 0 0 displayOrigin 0 displayMode USEPARENT customMaterial 32

        locked 0
        }

figure 
        {
---end snippet---

The text in "SwordMAT.txt" file might then look something like this: { material Preview { KdColor 0 1 0 1 KaColor 0 0 0 1 KsColor 1 1 1 1 TextureColor 1 1 1 1 NsExponent 10 tMin 0 tMax 0 tExpo 0.6 bumpStrength 1 ksIgnoreTexture 0 reflectThruLights 1 reflectThruKd 0 textureMap "Ground Default Texture.tif" 0 0 bumpMap NO_MAP reflectionMap NO_MAP transparencyMap NO_MAP ReflectionColor 1 1 1 1 reflectionStrength 1 } }

I have tested these methods in P4 and P5, I don't have P6, but I imagin they will probably work in that version. Some more info on readScript at this URL: http://www.rbtwhiz.com/rbtwhiz_rScript.html