Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
:tt1:
Wow, collectsceneinventory is my favorite script; and I've wished it would rewrite the .PZ3 o reflec the address of the new texture locations! And, yes, this will be great for working/reworking on textures!
Would you elaborate on the first change, I'm not sure I understand; other than now it will look through every added runtime? Could'nt that get a little labor intensive?
Edited versions of some of the scripts which shipped with Poser 5 were being posted to this forum a couple of years ago. That's precedent, at least, but I don't know that it really establishes whether such redistribution is deemed acceptable by Renderosity or eFrontier.
===========================sigline======================================================
Cage can be an opinionated jerk who posts without thinking. He apologizes for this. He's honestly not trying to be a turkeyhead.
Cage had some freebies, compatible with Poser 11 and below. His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.
In Poser it's possible to enter a relative path for a texture, which looks like "Runtime:Textures:Mytextures:Chainmail.jpg". Poser will search for that texture in all Runtimes, since there is no information about in which Runtime the object is.
And no, it does not put strain the system. The path is there, the script just checks 2 possible positions per Runtime, and only if the file wasn't found at the first position. Done in less than a second on my system, which has about ten runtime folders.
A ship in port is safe;
but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing
Grace" Hopper
Avatar image of me done by Chidori.
There are still references to the old textures in the Poser 4 material system. I will fix that today and will send the script to anyone intrested for beta testing. Angelouscritry, you will get a message as soon as I am through with that.
Give me some hours, since I still have to help my oldest son with a school project. It takes some time, I never learned Python properly so it's a lot of reading while writing. But I have some experience in programming, so it's just a question of time.
A ship in port is safe;
but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing
Grace" Hopper
Avatar image of me done by Chidori.
You have mail.
The main problem is that I'm not used to Python and the Poser Python library. I ran in all kind of stupid errors because of that. I checked the script only with a few scenes up to now, but I will try more in the next few days. I hope you will find the time to check it too.
I will ask SmithMicro for permission before I distribute it openly, but I suspect no problems there.
Tell me what the script does and doesen't do, and tell me if you have any idea about improvement or further options. I plan to add an option for OBJ-export of the whole scene, to make it usefull for PoseRay-users too.
A ship in port is safe;
but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing
Grace" Hopper
Avatar image of me done by Chidori.
Hmm, I should have got this a couple hours ago, did you hit Send/Receive? I also checked that the e-mail I IM'd you is correct.
Wow; an .OBJ export, for the whole scene, would be a huge bonus for Poser user's too! I think, this is the best way to cut down on a scene's size! I know extra morphs are heavy, and I've been told Poser rigging is too. I'd definitely like Beta Testing rendering a .PZ3 scene, converted to .OBJ, with Poser!
The email should be correct.
I sent you a message via site mail. You can download the script from the link there.
The problem with OBJ-export is that you loose the materials. PoseRay uses a PZ3 for camera, materials and lights and an OBJ file for the actual geometry, and make a file which can be rendered in POV-Ray.
I used to work with Pov-Ray a lot some years ago and do still renders with it. Pov can do radiosity and smooth shadows, but won't to displacement until the model is further subdivided. The speed isn't breathtaking though, if you use radiosity and good anti-aliasing.
When you import the OBJ somewhere else, you probably will have to redo the materials. I will try to write a new .mat file too, but I don't know if the results will be that great. We will see.
A ship in port is safe;
but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing
Grace" Hopper
Avatar image of me done by Chidori.
Got it! I'll test tonight, or tomorrow night(am working both but will find time;) and be back, here, ASAP!
I see, thanks. I'd heard something about Materials, but did'nt quite follow.
Do you think it would be possible, to do this(convert Figures/Props to OBJS,) without leaving the .PZ3(thus keeping materials?)
I have already sent an email to e-frontier/SmithMicro, asking for an OK to distribute. I will give them some days to answer and then either diff it or encode it if there is no answer.
We will seel.
Angelouscuitry, as I said the OBJ export I had in mind is for PoseRay mostly. In which application would you want to import the exported OBJ?
A ship in port is safe;
but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing
Grace" Hopper
Avatar image of me done by Chidori.
You could also just tell people what information to insert in which lines and let them add the information themselves, to their own copy of the original script....
===========================sigline======================================================
Cage can be an opinionated jerk who posts without thinking. He apologizes for this. He's honestly not trying to be a turkeyhead.
Cage had some freebies, compatible with Poser 11 and below. His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.
It would be probably easier to use diff - I have not only added code but changed some functions as well. I will give E-Frontier some days, then I will deliver a Zip file which includes an encoded and a diff-ed version - so people can choose.
That will give me and my two testers some time to finish testing - if someone needs it urgently then I will send a version - i do react on site mail. But before I post a link in the Vue forum (it'r really usefull for Vue users, since you want to resize the textures there before importing) I want to be sure that I haven't overlooked some major bug - I am quite good at that.
A ship in port is safe;
but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing
Grace" Hopper
Avatar image of me done by Chidori.
Line 8 collects the runtime directories in a list. The function I used there obviously is Poser 7 only, I tried the script in Poser 6 some minutes ago (I hadn't installed it any more, had to dig for it in the backups) and got the same error. Obviously Poser6's Python library has no function to get the library folders. :frown:
It should work if you replace line 8. At the moment it says:
**
libs=poser.libraries()
change it to:
libs=("C:P6","C:otherruntime1","C:otherruntime2")
**You will have to enter your runtime directories there. Just enter every runtime directory between the brackets, seperated with collums. Use double backslashes, because Phyton uses a single backslash as control character. If you don't have external runtimes, the first entry is enough. (Path taken from your picture, should be your Poser Runtime directory).
So if you would have a Runtime at D:DataPoserdataRuntimeLibraries.... you would write
"D:DataPoserdata" within the brackets.
Since I cannot ask Poser to do it, you will have to do it yourself. Sorry.
A ship in port is safe;
but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing
Grace" Hopper
Avatar image of me done by Chidori.
Wasn't really awake. You will have to use this brackets; [ ] for the list, not the normal ones.
libs=["poserdir","runtime2","runtime2"]
in this way,#
A ship in port is safe;
but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing
Grace" Hopper
Avatar image of me done by Chidori.
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
Hi. I changed the "CollectSceneInventory.py" script, which is a standard Utility, to make it usefull.
The two major changes are that it will handle textures with a relative path now. ("Runtime:textures:...") It searches the texture in all included libraries, with the relativ path found in the node
Second, it changes the node to point at the new location before saving. This is usefull if you want to resize or change the textures without harming the original ones - the original script saved a pz3 which still points at the original locations and would not always copy textures with a relative path.
Does anyone know if it's ok to distribute the hacked version? Since all Poser users have the original version, and people without Poser cannot do anything without it?
I could encode it or use diff of course, but will that be nessesary?
A ship in port is safe; but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing Grace" Hopper
Avatar image of me done by Chidori.