Wed, Dec 25, 1:02 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Dec 23 7:38 pm)



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


muralist ( ) posted Thu, 18 May 2006 at 5:14 PM · edited Wed, 25 December 2024 at 1:17 AM

In my props and figures the file refernces external geometry.  How do I do the same with prop files -- For example I have 30 figures, but they all share the same 6 sword props.   Currently each cr2 file has for each prop, a geometry refernce and materials, etc.  When I want to modify a material on the swords, I have to modify 30 files.  How do I amke the cr2 r4efernce the prop so I only ahve to modify it and the change is propagated globally?


MaryK ( ) posted Fri, 19 May 2006 at 1:39 AM

Attached Link: Morphworld Tutorial

Try this


muralist ( ) posted Fri, 19 May 2006 at 3:37 AM

Thank you.  I already employ this method of reference in my props.  What I want is to do similar with prop calls from figures.


DCArt ( ) posted Fri, 19 May 2006 at 9:01 AM · edited Fri, 19 May 2006 at 9:02 AM

One alternative is to rename your first material, and assign the first material name to the second material you want to use.

However, if you're changing the materials to animate a change between one and another, I'm wondering if a Python script might do the trick for you (that is, if you have Pro Pack, P5, or P6).  That seems like the most logical and automatic way to accomplish it. I'm not a Python expert, but there are a few that hang around these parts. 8-)



muralist ( ) posted Fri, 19 May 2006 at 12:04 PM

Currently if I have a figure holding a sword prop, I have 2 copies of the prop:  1 in the Props dir, and one embedded in the cr2.  I'm talking about simply referencing the one prop file rather than duplicating it inside the cr2.


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


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.