odf opened this issue on Oct 27, 2008 · 13964 posts
lesbentley posted Fri, 23 October 2009 at 6:25 PM
@odf,
Quote - As for keeping both UV mappings, that's definitely what I'm aiming at. All we need is a user-friendly way to switch that's not too much of a pain to maintain. But lesbentley's experiments with geometry switching could lead to a solution there, and if not, there are other options to look into.
I have taken my experiments with injecting differently UV mapped geometry about as far as I can in P6. As P6 is the only version I have installed, that is all that I can test. Everything is working fine at my end, so I guess it is now up to odf as to what he wants to do with it.
To summarise the experiments:
The purpose of the experiments was to determine whether differently UV mapped geometry could be injected into the figure whilst it was loaded in Poser, and without affecting the morphs or other functionality of the figure. The answer is "yes" as far as P6 goes, but it needs testing in other versions.
No way has been found to inject new geometry via a 'figureResFile' statement in a way that will survive a save and reload, thus the new geometry needs to be loaded as a separate obj file for each actor, via 'objFileGeom' statements (same syntax as in a pp2).
With this method the winding order and vertex count of the individual obj files needs to match those of corresponding groups in the full body obj file (whole actor groups may be safely omitted). For example, it does not seem possible to use this method to inject the low-res mesh into a figure that is using the high-res geometry. The UV mapping, material zones, and position of the vertices (shape of the mesh) can vary. I do not know how the inclusion of different sub-groups within an actor would affect the outcome.
There are two ways to restore the original geometry/UVs after a different geometry has been injected. The original declaration section of the cr2 ('geomHandlerGeom' blocks), together with the two 'figureResFile' lines can be injected. Or, the geometry can be injected via individual per-actor obj files.
The down side: The biggest problem I can see with this method is the possibility of the end user injecting the low-res geometry into the high-res figure, or vice versa, this would cause bizarre looking results. The cure is to restore the original geometry. Some things come to mind to minimise this risk. In the thumbnail for the injection pose, include text like "For HighRes Figure ONLY". Place the injection files for high and low res versions in different folders.
Injecting a different geometry may cause transparency maps not to work in preview (though they will still work in a render). For example the eyelashes may not show in preview. This can be cured by a Save and Revert (or reload) of the pz3. Saving and reloading a cr2 will also cure the problem.
So that's the story. I have done a reasonably thorough testing in P6, and it all works in that version. I am reasonably confident that this will work in other Poser versions, but as with anything new, one can not be 100% confidant until it has been tested by different people in different Poser versions, on different systems, and not to forget D|S. I suggest that at a minimum someone needs to do a little testing in P8 before it is included in a preview release. My current injection files work on either the "Antonia-114.cr2" or the "Antonia-116-AltUV2.cr2", and would presumably work on the Antonia-116 standard version when it is released. I also have equivalent versions for the low-res figure. The restore file is specific to the cr2 being restored, as it needs to use the same figureResFile line. At the moment I have only made a restore file for the "Antonia-116-AltUV2.cr2". The restore file is something of an optional extra, as you can use the two injection files to swap between the different geometries.
There are different permutations of files that you can have with this system. The two that seem most logical are:
One copy of an alternately UV mapped geometry as a set of individual obj files for each actor, one full figure obj loaded by the default cr2, one geom-INJ file, one restore file.
Or, a cr2 that loads the geometry as individual obj files, with one copy of the default geometry as individual obj files, and one copy of an alternately UV mapped geometry as a set of individual obj files, plus two geom-INJ fles.
The second alternative seems the most logical and flexible, but it also represents putting all your eggs in one basket with a new system that has not been thoroughly field tested.
odf: I think the time has come for me to hand this over to you. To include or not as you see fit. I have already posted example files in this thread. If you like I can package everything as an automatic install in a zip, either with or without the obj files. I can send the zip to you, or post it on the developers site, or you can just have a play with the files already posted. Just let me know where you want to go with this.