PmWiki   PublicWiki /
ConvertingGeomCustomToObjFileGeom
SearchWiki
PublicWiki.RecentChanges
Edit Page
Page Revisions

One of the most-called for abilities in Poser content creation is the ability to seperate geometry from a prop file. All versions of Poser tend to embed the geometry in an imported and saved prop right inside the prop file itself, but this is often not liked. As of this writing, such imported props do not work consistently in DAZ|Studio, and many brokerages require such props be made seperate from their prop files.

As with most Poser content, a Prop is broken into two primary parts, the declaration and the definition. Whether the prop has embedded geometry or not, the defnition should be the same and is nothing to worry about.

The declaration section, however, will contain vastly more data for an embedded-geometry prop than does one in which the prop is stored externally in a prop file. This size and non-modularity, along with the fact that only Poser and custom-scripted apps can read this embedded geometry out, is probably the biggest reasons that users tend to dislike prop geometry being embedded.

The easiest way to avoid this is to keep the imported object file around and in a location easily read by Poser (in other words, in a location under the Poser Runtime heirachy).

When you crack open your prop file, you will find a section that looks like this:

 prop something
	{
	geomCustom
		{
		numbVerts 3920
		numbTVerts    0
		numbTSets     0
		numbElems   7724
		numbSets    23172
		v -0.000000 0.184900 -0.001009
		v 0.045431 0.184900 -0.001009
		v 0.042691 0.184900 -0.016548
		...
		f 3917 3920 3918
		f 3918 3920 3919
		f 3919 3920 3908
		} 
	}

If you still have the object handy, you can refer directly to it by removing the geomCustom section altogether and referring to it with an objFileGeom directive. Traditionally, you also add a storageOffset directive at this point, before th objFileGeom directive. The storageOffset directive is, traditionally, set to (0 0.3487 0) for objFileGeom-read geometry.

The result will look something like this:

 prop something
	{
	storageOffset 0 0.3487 0
	objFileGeom 0 0 :Runtime:Geometries:YourProps?:something.obj
	}

Note those zeroes after the objFileGeom directive but before the file path. These are generally considered necessary. The prop will load if you leave them out, but it will save wrong if you save out a PZ3 file. When you try to load back in the PZ3 thus saved you will get the can't-find-geometry error and the stupid 'out-of-memory-we-didn't-change-this-for-the-PC' error. Both of which are wrong and misleading in the extreme. If you examine the PZ3 file, you will find those zeroes are there automatically, except that they aren't zeroes -- they're very long numbers, sometimes in the negative. This is what messes up the opening of the file. Make sure you include those zeroes.

Now, if you haven't saved that OBJect? file, or if you've changed it in the grouping editor or something after importing (lets say you've flipped facets and assigned groups and materials or something), then you can't just point it at the original because the original is either not there or not the same as what your prop is meant to be.

There's a way around this, too, and it's not as hard as exporting the object and starting all over again. It's actually pretty simple if you have a good text editor.

All you have to do is open up two text editors. Open the PP2? file in one. Then extract the entirety of the contents of the geomCustom block (i.e., stuff between the { and }. but not the { and } themselves, nor the geomCustom itself).

Paste this into the other text editor window. Then, in that other window, use a global search and replace to remove all leading whitespace. If you use the vim editor (the one I recommend), then you can do this with the command :%s/^^I// (the character '^I' is a tab, which you can get either by pressing TAB or CTRL-I). The idea is to simply remove all that leading space so that all those V's and F's are against the side, not halfway across the page.

Next, add the character '#' before all those numbVerts and such lines right at the beginning. The results will look sort of like this:

 numbVerts 3920
 numbTVerts    0
 numbTSets     0
 numbElems   7724
 numbSets    23172
 v -0.000000 0.184900 -0.001009
 v 0.045431 0.184900 -0.001009
 v 0.042691 0.184900 -0.016548
 ...
 f 3917 3920 3918
 f 3918 3920 3919
 f 3919 3920 3908


Save this text file to a new file with the extention '.obj'. That's a wavefront object file, which is what this now is.

Next, use the above directions to point the PP2? file at the OBJect? file, removing the geomCustom section entirely.


Edit Page - Page Revisions - WikiHelp - SearchWiki - RecentChanges
Page last modified on December 09, 2004, at 11:59 PM