grichter opened this issue on Feb 09, 2011 · 7 posts
grichter posted Wed, 09 February 2011 at 7:48 PM
Not at my python computer so might have this backwards. You can check by internal name which I believe returns just figure1, etc. Or by external name ala V4.2, but the user can change that (which I have myself done). Plus if you add more then one figure of the same name it adds the 1 etc on the end of the figure name.
So is the best way to check the object file to make sure the character you are about to run a script on belongs to V4 (A4, G4, SP4) or is there another sure-fire way that everybody uses? Have a script I am studying that uses the object file method, which I have yet to try. But everything else I have dreamed up based on trying to use figure names has failed so far.
TIA
Gary
"Those who lose themselves in a passion lose less than those who lose their passion"
bagginsbill posted Wed, 09 February 2011 at 9:54 PM
The set of all material names is pretty unique to Daz Mil4.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
markschum posted Wed, 09 February 2011 at 10:30 PM
You can get the geometry file name, or you can get the geometry itself and check the vertex count. I am not sure that unique though. Geom file name seems easiest.
grichter posted Wed, 09 February 2011 at 10:31 PM
True. Have a check on 2_SkinTorso.
Looked at two different scripts and both used two different methods. One was troubling because it created a figureList which also picked the first character that matched "2_SkinTorso". So if you had V4 and SP4 in the scene and tried to apply the script to SP4 it was a no go if they were in the scene after V4. Same applied to 2 V4's. Like the script was designed for there never to be more then one figure in the scene. Which then lead me to look in another script that looked for the various blmilwom_v4 object files.
Guess I should revert to keep it simple stupid, instead of trying to be overly complex for no apparent reason.
Gary
"Those who lose themselves in a passion lose less than those who lose their passion"
markschum posted Wed, 09 February 2011 at 11:21 PM
You have to loop through all figures and build a list of which ones are what you want if theres more than 1.
I do most of my scripts to work on currentfigure, and test for the geom file if it must be V4. I have a couple scripts that load and conform clothing that do a check.
grichter posted Wed, 09 February 2011 at 11:50 PM
My test scene had 2 V4's and 1 SP4 in it and using f = poser.Scene().CurrentFigure() to start my figure check and then test the material zones allows me to apply a second skin IE: BB's nylons textures with a pantyhose displacement map I created etc to any valid fgure (hip, leg and foot) in the scene that is selected.
Gary
"Those who lose themselves in a passion lose less than those who lose their passion"
PhilC posted Thu, 10 February 2011 at 4:48 AM
I would use this method:-
import poser
import os
scene = poser.Scene()
for fig in scene.Figures():
geomFile = os.path.split(fig.GeomFileName())[1]
if geomFile == "blMilMan_m4b.obj":
print "%s based on %s IS an M4 figure" % (fig.Name(),geomFile)
else:
print "%s based on %s IS NOT an M4 figure" % (fig.Name(),geomFile)