Wed, Sep 18, 1:57 PM CDT

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: Changed "CollectSceneInventory"


bantha ( ) posted Sat, 23 February 2008 at 5:55 PM · edited Wed, 24 July 2024 at 3:38 PM

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


Angelouscuitry ( ) posted Sat, 23 February 2008 at 10:00 PM

: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?


Cage ( ) posted Sat, 23 February 2008 at 11:34 PM

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.


bantha ( ) posted Sun, 24 February 2008 at 12:57 AM

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


Angelouscuitry ( ) posted Sun, 24 February 2008 at 8:35 AM

:thumbupboth:


bantha ( ) posted Sun, 24 February 2008 at 10:00 AM

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


Angelouscuitry ( ) posted Sun, 24 February 2008 at 10:36 AM · edited Sun, 24 February 2008 at 10:38 AM

Thank you so much for your time, please take as much as you need; I've waited...forever, so far!  I could'nt say just how complicated this script is; but for what it will be doing, I'm feel insuring that this script runs properly will be very important?

Thanks again!

:lol:


bantha ( ) posted Sun, 24 February 2008 at 2:22 PM

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


Angelouscuitry ( ) posted Sun, 24 February 2008 at 3:29 PM

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!


bantha ( ) posted Sun, 24 February 2008 at 3:50 PM

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


Angelouscuitry ( ) posted Sun, 24 February 2008 at 4:53 PM

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?)


ytetsu ( ) posted Sun, 24 February 2008 at 10:14 PM

For avoiding copyright problem, you can releale as diff file.
There are some diff tools for windows.
Mac OSX users can use unix diff tool.


bantha ( ) posted Sun, 24 February 2008 at 11:27 PM

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


Angelouscuitry ( ) posted Mon, 25 February 2008 at 11:02 AM

Poser, I was just asking in case you happened to run into how to keep the OBJ within Poser; thanks.


Cage ( ) posted Mon, 25 February 2008 at 2:13 PM

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.


bantha ( ) posted Mon, 25 February 2008 at 2:26 PM

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


Angelouscuitry ( ) posted Mon, 25 February 2008 at 8:39 PM · edited Mon, 25 February 2008 at 8:41 PM

file_400737.jpg

This is my Poser default scene.  I'd just; opened Poser, ran CollectSceneInventory.PY(as a control,) and clicked what I named your script(CollectSceneInventoryMod.PY,) then the attached error message followed?


bantha ( ) posted Tue, 26 February 2008 at 12:08 AM

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


bantha ( ) posted Tue, 26 February 2008 at 12:29 AM

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


Angelouscuitry ( ) posted Tue, 26 February 2008 at 10:55 AM

I should have mentioned I was using Poser 6.  I got a refund on Poser 7; because I could'nt get V3 to load properly, and then the Morph Tool never worked for her. I still own Poser 7, and will install; test, again.  Give me a couple days...


Privacy Notice

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.