Adding Geometry Switching (Oldschool Stuff) - What Stupid Mistake Am I Making ?



  • I have a non-standard figure (bookshelf contents, so none of the usual bodypart names) and I want to use old-school geometry swapping on it.

    I created a very (very) simple mesh in Blender, imported into PP2014,rigged it (very, very simply), saved it as a CR2,and reloaded that to make sure it's okay.

    I then manually edited a copy of that CR2 to add geometry switching for one shelf, as per pp109-113 of the old BLRender tome. Basically create the alternate geometry file, add an alternateGeomline pointing to the obj, and add ageomChan for the new dial.

    actor shelf4:2
    	{
    	name    Shelf_4
    	...
    	alternateGeom Shelf4_1
    	{
    			name	Shelf41
    			objfile	9401 :Runtime:Geometries:Shelf4B.obj
    	}
    	channels
    		{
    		...		
    		geomChan shelf4Geom
    			{
    			uniqueInterp
    			name Shelf_Variants
    			initValue 0
    			hidden 0
    			forceLimits 4
    			min 0
    			max 2
    			trackingScale 0.045
    			keys
    				{
    				static  0
    				k  0  0
    				}
    			interpStyleLocked 0
    			}
    		...
    

    However, when I load the edited CR2 no geometry at all is loaded for the shelf in question. The dial lets me select 0 or 1, but nothing else happens.

    0_1534859247811_altgeom.jpg

    I'm almost certainly doing something really stupid, or overlooking something really simple...

    Help please ?



  • @3dcheapskate choosing Poser Unimesh for the figure skinning breaks geometry switching. You must use Poser Traditional if you want the geomChan settings to be honoured.



  • By the way, the base geometry is already in an external object file, so it's not that:

    {
    
    version
    	{
    	number 10.04
    	build 28925
    	}
    figureResFile :Runtime:libraries:Character:BookrowsTest01.obj
    actor BODY:2
    ...
    


  • @3dcheapskate I'd also set the trackingScale to 1 (though I'm pretty sure uniqueInterp overrides that) to remind yourself that there is no possibility of interpolation between geometries (nice thought being able to blend shapes, but it can't work) :-)



  • @anomalaus Just checked that - it's set to Poser traditional.
    0_1534860724659_skun.jpg



  • @3dcheapskate not sure then. That's what I'd changed when I converted a figure to unimesh, and it immediately broke the geometry switching, until I reverted.

    Can you show the entire obj declaration section for all the shelves?



  • @anomalaus I posted the lines specifying the base geometry (all six shelves) a couple of posts back - here it is again:

    {
    
    version
    	{
    	number 10.04
    	build 28925
    	}
    figureResFile :Runtime:libraries:Character:BookrowsTest01.obj
    actor BODY:2
    ...
    

    I've only created an alternate geometry OBJ for shelf4. Here's the altGeom and geomChan bits inserted into the main shelf4 section...

    actor shelf4:2
    	{
    	name    Shelf_4
    	on
    	bend 1
    	animatableOrigin 0
    	dynamicsLock		0
    	hidden		0
    	addToMenu	1
    	castsShadow		1
    	includeInDepthCue		1
    	useZBuffer		1
    	parent bone_1:2
    	creaseAngle 80
    	subdivLevels 0 
    	subdivRenderLevels 0 
    	subdivideWithFigure 1 
    	backfaceBehavior 1
    	alternateGeom Shelf4_1
    	{
    			name	Shelf41
    			objfile	9401 :Runtime:libraries:Character:Shelf4B.obj
    	}
    	channels
    		{
    		groups
    			{
    			groupNode Transform
    				{
    				parmNode xRotate
    				parmNode yRotate
    				parmNode zRotate
    				parmNode Scale
    				parmNode xScale
    				parmNode yScale
    				parmNode zScale
    				parmNode xTran
    				parmNode yTran
    				parmNode zTran
    				}
    			groupNode Other
    				{
    				parmNode OriginZ
    				parmNode OriginY
    				parmNode OriginX
    				}
    			}		
    		geomChan shelf4Geom
    			{
    			uniqueInterp
    			name Shelf_Variants
    			initValue 0
    			hidden 0
    			forceLimits 4
    			min 0
    			max 2
    			trackingScale 0.045
    			keys
    				{
    				static  0
    				k  0  0
    				}
    			interpStyleLocked 0
    			}
    		xOffsetA OriginX
    			{
    			...
    


  • F*ing 150 second post edit timeout ! That's only 2½ minutes !

    P.S. The book advised against setting tracking scale to 1 as that makes it too sensitive (I know that's correct - I tried it ages back)



  • Okay, I found why the shelf4 mesh isn't appearing when I load the edited CR2.
    I did a global change in the CR2 of the name 'bone_5' to 'shelf4' - but overlooked the 'g bone_5' in the base mesh OBJ file.
    So now all 6 shelves appear when I load my edited CR2.

    Changing the 'Shelf_Variants' dial on the parameter tab for Shelf_4 still has no effect on the mesh - the base shelf 4 mesh remains.



  • The alternate geometry for shelf4 is in the exact same location asthe base geometry, i.e. 'Runtime\libraries\Character' (cut-and-pasted from Windows Explorer) and the file is 'Shelf4B.obj'

    And I can manually import that OBJ without a hitch.

    And the location matches the 'objfile 9401 :Runtime:libraries:Character:Shelf4B.obj' in my edited CR2.



  • Hmmm... if I rename my alternate geometry OBJ file, so the CR2 'alternateGeom' 'objfile' line is pointing at a file that doesn't exist then I get exactly the same symptom - I turn the 'Shelf_Variants' dial and,apart from the dial value changing 0-> 1, nothing happens.



  • @3dcheapskate said in Adding Geometry Switching (Oldschool Stuff) - What Stupid Mistake Am I Making ?:

    		name	Shelf41
    		objfile	9401 :Runtime:libraries:Character:Shelf4B.obj
    

    No idea if it will help, but try renaming .. name Shelf41 To same same as the alternateGeom of Shelf4_1. So it would be

    		name	Shelf4_1
    		objfile	9401 :Runtime:libraries:Character:Shelf4B.obj

  • Poser Ambassadors

    https://www.renderosity.com/mod/freestuff/geometry-stripper/48560

    Nice utility to extract and swap the geometry.



  • @3dcheapskate what I meant by the obj declaration section is the earliest section where the geometries for the figure and it's actors have their file references specified, not the actual actor block with its channel definitions.

    So, something that looks like:

    figureResFile :Runtime:Geometries:<some_place>:<Some_thing>.obj
    actor BODY:1
    	{
    
    	}
    controlProp GoalCenterOfMass:1
    	{
    
    	}
    controlProp CenterOfMass:1
    	{
    
    	}
    actor Base:1
    	{
    	storageOffset 0 0 0
    	geomHandlerGeom 13 Base  
    	}
    actor RearPivot:1
    	{
    	storageOffset 0 0 0
    	geomHandlerGeom 13 RearPivot  
    	}
    actor FrontPivot:1
    	{
    	storageOffset 0 0 0
    	geomHandlerGeom 13 FrontPivot  
    	}
    ...
    prop CapsuleTop 1:1
    	{
    	storageOffset 0 0.3487 0
    	objFileGeom 0 0 :Runtime:Geometries: GeoffIX:CapsuleTop.obj
    	}
    

    which ties the group names specified in the obj files to the actors' internal names, via the geomHandlerGeom statement. They need to match exactly at the actor name:number lines. The group name within the geometry file does not need to match the alternateGeom reference, as long as it is specified correctly in the geometry declaration section.

    @rlowens68 from looking at my own geometry switching examples, which I used to use extensively back in Poser 7 days to hide body parts without scaling, prior to Poser supporting animatable visibility for actors, (I'd swap the geometry for Null.obj to hide body parts), the names specified on and within the alternateGeom block don't need to match anything. The match occurs between the alternateGeom declaration and the geomChan declaration:

    prop CapsuleTop 1:1
    	{
    	...
    	alternateGeom    capsuleTop_1
    		{
    		name Hidden CapsuleTop
    		objFile 20 <long_omitted_path>/Runtime/Geometries/Null.obj
    		}
    	creaseAngle 80
    	channels
    		{
    		groups
    			{
    			...
    			groupNode Other
    				{
    				collapsed 1
    				parmNode OriginZ
    				parmNode OriginY
    				parmNode OriginX
    				parmNode Flex
    				parmNode HideCapsule
    				}
    			groupNode Morph
    				{
    				parmNode Open
    				parmNode TwistTop
    				parmNode SquaredTop
    				}
    			}
    		...
    		geomChan HideCapsule
    			{
    			uniqueInterp
    			name Hide Capsule
    			initValue 1
    			hidden 0
    			forceLimits 1
    			min 0
    			max 1
    			trackingScale 1
    			keys
    				{
    				static  0
    				k  0  1
    				}
    			interpStyleLocked 1
    			valueOpDeltaAdd
    				Figure 1
    				Base:1
    				Capsule
    			deltaAddDelta -1.000000
    			}
    		targetGeom SquaredTop
    

    You'll notice that not one of the "capsuleTop_1", "Hidden CapsuleTop", "HideCapsule" or "Hide Capsule" references actually matches another, yet it still works.

    I guess the 9401 has been copied from some other example of geometry switching. Along with the 13 for body actors and the 20 I've used, I imagine it's meaning and relevance has evaporated in the mists of time.

    @3dcheapskate another thing to try, though it's not geometry switching, is to temporarily replace the geomHandlerGeom line for that shelf with "objFileGeom 0 0 :Runtime:libraries:Character:Shelf4B.obj" and see if the figure will load with the alternate shelf geometry. That would confirm that Poser is finding the file from that reference, rather than you locating it manually.



  • @Biscuits -Thanks, just downloaded it. Although manually extracting geometry to an external OBJ and replacing it with a reference via an 'objfile' is something that's never caused me problems in the past, Ifind that making typos is something I (or more accurately, my keyboard ;o) tend to domore frequently nowadays.



  • @rlowens68 Thanks for the suggestion. Tried it - same problem ,so it's not that. In the book it used different names,and anomalaus has confirmed that too a few posts below yours.



  • @anomalaus Sorry, it was late and I was half asleep ! ;o)

    {
    
    version
    	{
    	number 10.04
    	build 28925
    	}
    figureResFile :Runtime:libraries:Character:BookrowsTest01.obj
    actor BODY:2
    	{
    	storageOffset 0 0 0
    	geomHandlerGeom 13 BODY  
    	}
    controlProp CenterOfMass:2
    	{
    
    	}
    controlProp GoalCenterOfMass:2
    	{
    
    	}
    actor bone_1:2
    	{
    	storageOffset 0 0 0
    	geomHandlerGeom 13 bone_1  
    	}
    actor bone_2:2
    	{
    	storageOffset 0 0 0
    	geomHandlerGeom 13 bone_2  
    	}
    actor bone_3:2
    	{
    	storageOffset 0 0 0
    	geomHandlerGeom 13 bone_3  
    	}
    actor bone_4:2
    	{
    	storageOffset 0 0 0
    	geomHandlerGeom 13 bone_4  
    	}
    actor shelf4:2
    	{
    	storageOffset 0 0 0
    	geomHandlerGeom 13 shelf4  
    	}
    actor bone_6:2
    	{
    	storageOffset 0 0 0
    	geomHandlerGeom 13 bone_6  
    	}
    actor bone_7:2
    	{
    	storageOffset 0 0 0
    	geomHandlerGeom 13 bone_7  
    	}
    figureResFile :Runtime:libraries:Character:BookrowsTest01.obj
    
    actor BODY:2
    	{
    	...
    


  • (Darn 150s timeout - who's stupid idea was that? 10 minutes was bad enough!)

    The 9401 was completely arbitrary. The book said to use four digits in format BBAA where BB indicates bodypart and AA indicates which alternate geometry. So I randomly decided that shelf4 is 94, and this is the first alternate geometry, so it's 9401. I tried a different number,1001 -same problem.



  • This is the BookrowsTest01.obj, created by Poser when I used the Setup Room (and after I changed 'bone_5' to 'shelf4'to match the edited CR2)

    #		numbVerts    48
    #		numbTVerts    6
    #		numbTSets     144
    #		numbElems   36
    #		numbSets    144
    v -0.262818 0.022949 0.049910
    ...
    vt 0.000000 0.000000
    ...
    usemtl None
    s 5
    g bone_2
    f 1/1 2/1 4/1 3/1
    ...
    g bone_3
    f 9/2 10/2 12/2 11/2
    ...
    g bone_4
    f 17/3 18/3 20/3 19/3
    ...
    g shelf4
    f 25/4 26/4 28/4 27/4
    ...
    g bone_6
    f 33/5 34/5 36/5 35/5
    ...
    g bone_7
    f 41/6 42/6 44/6 43/6
    ...
    
    

    This was the original OBJ for the alternate geometry:

    # Blender v2.79 (sub 0) OBJ File: ''
    # www.blender.org
    v 0.050179 0.475192 0.050000
    ...
    vt 0.000000 0.000000
    ...
    usemtl None.003
    s off
    g bone_5
    f 1/1/1 2/2/1 3/3/1 4/4/1
    ...
    
    

    I wondered if perhaps I needed to match the group name in that to the CR2 and base OBJ as well,soI changed it to this:

    # Blender v2.79 (sub 0) OBJ File: ''
    # www.blender.org
    v 0.050179 0.475192 0.050000
    ...
    vt 0.000000 0.000000
    ...
    usemtl None
    s 5
    g shelf4
    f 1/1/1 2/2/1 3/3/1 4/4/1
    ...
    
    

    Still the same problem.



  • @anomalaus said in Adding Geometry Switching (Oldschool Stuff) - What Stupid Mistake Am I Making ?:

    ...@3dcheapskate another thing to try, though it's not geometry switching, is to temporarily replace the geomHandlerGeom line for that shelf with "objFileGeom 0 0 :Runtime:libraries:Character:Shelf4B.obj" and see if the figure will load with the alternate shelf geometry. That would confirm that Poser is finding the file from that reference, rather than you locating it manually.

    Indeed it does, so Poser can definitely find and load the alternate geometry OBJ. So that seemsto confirm that I'm doing something wrong in the actual geometry swapping code in the CR2. But there's so little of it!
    0_1534909428775_altbase.jpg