Forum: Poser Python Scripting


Subject: collectsceneinventory.py?

Angelouscuitry opened this issue on Nov 26, 2007 · 8 posts


Angelouscuitry posted Mon, 26 November 2007 at 2:51 PM

I do'nt understand why this script is reporting it ca'nt find these texture maps, nor do I understand why the bad Geometry message is apparent?

I checked that each of these Material Room's Material Zones' still knows of it's texture maps, and that the address' of those maps are still available!

I have Compression and External Binaries off.  AndI also ran the uncompressposerfiles.py on my runtime, and searched the .PZ3(with a tet editor) for any uncompressed .OBZs!

Usually I have no problems running this script, but this time it' wo'nt copy anything external to the .pz3?  The scene saves, loads, and renders fine; but I still wo'nt a complete archive of the scene, for if/when it's to be used on a new/other runtime!


nruddock posted Mon, 26 November 2007 at 3:13 PM

You'll need to at least post the file names that are the subject of the error messages, and a few line either side of the AltGeom line, for anybody to have a chance of diagnosing the problem.

If you could also try removing items from the scene to see if one particular one is the cause of the trouble.


adp001 posted Mon, 26 November 2007 at 3:15 PM

Which Poserversion?
I've just installed P7 and my "collectSceneInventory.py" doesn't have a function with name "appendAltGeom" at or near line 36.




nruddock posted Mon, 26 November 2007 at 4:43 PM

Quote - Which Poserversion?

It's P6 (the first version of Poser that this script came with).
The fact that an "AttributeError" is being thrown suggests that the script is being run from P5 which doesn't have an AltGeomFileName method or there's something odd about the actor that's being worked on when the error occurs.


Angelouscuitry posted Mon, 26 November 2007 at 5:26 PM

nruddock - Thank you for helping!

This is happening to any scene I try to save, similarly, regardless of Figure(s.)

The beginning of the Script Window never lists any addresses nor names for an textures; it all looks like what's pictured in my first post all the way to the begging, as pictured here.

Pictured in my first post is the very end of the Script WIndow, what other AltGeom reference were you interested in?

adp001 - Thank you too!

I'm using Poser 6.  I think I heard you confirm,recently, P7 does a better job with compressed files?  I've had a lot of bad luck with Mil' Figures and P7; so my time with P6 goes on sometimes.

:thumbupboth:


Angelouscuitry posted Mon, 26 November 2007 at 6:09 PM

I had a bug; reinstalled Windows, and happened to keep a copy of my old P^ instal folder.  After reinstalling windows, I accidentally clicked the Poser.exe, of my old installation, and to own sigrin Poser loaded(without reinstallation.)  But then it quit this render, because it looked like ti would get more than 50Mbs RAM.

I reinstalled Poser and the actually installed application would occupy 700MBs of RAM, when rendering, and is what managed to complete the render above.

I just checked the old instalation, and it can complete collectsceneinventory.py, successfully!

This recent P6 installation was a Minimal Installation, and the collectsceneinventory.py was'nt actually in my new PoserScripts.  I'm hopiong I did'nt miss out on any Python faculties.  I've copied over my old Python directory, and checked it, but collectsceneinventory.py still fails; on the newly installed program?


adp001 posted Mon, 26 November 2007 at 6:59 PM

If I understand the script right (my version), it won't work with textures located outside the actual runtime, because of this:

def appendTexture(material):<br></br>    global maps<br></br>    try:<br></br>        for node in material.ShaderTree().Nodes():<br></br>            if node.Type() == poser.kNodeTypeCodeIMAGEMAP or node.Type() == poser.kNodeTypeCodeMOVIE:<br></br>                inp = node.Input(0)<br></br>                if inp.Type() == poser.kNodeInputCodeSTRING:<br></br>                    val = inp.Value()<br></br>                    if val != None and val!= "None":<br></br>                        help = os.path.dirname(poser.AppLocation())<br></br>                        val = os.path.join(help, val)<br></br>                        if not val in maps:<br></br>                            maps.append(val)<br></br>    except:<br></br>        print "Could not locate the texture map of the material: " + material.Name()

val is the name of the file extracted from the material node. help is the path where Poser exists.
os.path.join(help,val) concatenates the both, pointing to nowhere with the filenames you're using.

The error message is printed because an error occured while executing code between try and except. To say more you have to find out where and why the error is generated. Change the code to:

...<br></br>except Exception, err:<br></br>    print "EXEPTION %s, %s" % err<br></br>    print "Could not locate the texture map of the material: " + material.Name()

This should print the reason why an exception occured.




nruddock posted Tue, 27 November 2007 at 1:50 PM

adp001is correct, the P6 version of the script will only work with textures in the main Runtime.

I'd try the P7 version, as the method that deals with textures got changed to cope with the fact that textures might be elsewhere than the main Runtime.
Alternatively move/copy the textures to your main Runtime and change the relevant nodes to point the the new location (save Material collection, edit paths, then apply and resave PZ3).