Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 04 3:22 am)
That's great! Could use it on TerraDome for creating a forest . GUI? I am not a programmer but would like to help out with usability issues.
===========================================================
OS: Windows 11 64-bit
Poser: Poser 11.3 ...... Units: inches or meters depends on mood
Bryce: Bryce Pro 7.1.074
Image Editing: Corel Paintshop Pro
Renderer: Superfly, Firefly
9/11/2001: Never forget...
Smiles are contagious... Pass it on!
Today is the tomorrow you worried about yesterday
That's 748 props now. Randomly selected from a list of props (here now just 2 pieces, but the list of selectable props can theoretically be infinitely long). Two props each were set per polygon.
Number of polygons: 5196125.
Poser needed 50 seconds to generate the props.
By the way, the speed can only be maintained if the clones have the same textures. If you change even a small part of the texture, the speed drops dramatically (I stopped after 10 minutes). So setting random color values with a large amount of props is impossible.
Plants used:
Why not! But does it make sense to generate something like this in Poser? Wouldn't it be better to do it in e.g. Blender if the result is not used in Poser (just out of interest)?That's great! Could use it on TerraDome for creating a forest . GUI? I am not a programmer but would like to help out with usability issues.
The more props or polygons there are in total, the slower Poser will be when creating the props. The small computer I'm developing the script on (compared with my graphic workstation) has 16 Gig RAM and creates 1122 props with a total of 5580475 polygons in 125 seconds (so no linear slowdown, but almost exponential :)). The subsequent rendering goes quickly. However, if you move any prop to a different position, e.g. in the Hirarchy editor, Poser takes a seemingly infinitely long time until it reacts again.
I have run the script several times in a row. The result of the time needed is always the same and there were no problems. The number of polygons varied between about 4 and 6 million, depending on which props were randomly selected.
At this point, praise to Poser 12: During hours of testing with a really large amount of props and polygons, there were no crashes. Memory leaks do not seem to exist. The props are deleted and regenerated as expected.
Here is the result: 1122 props generated, 3 props per ground polygon, randomly selected from a set of 4 different props (where 2 props have the same geometry but different textures):
Looks good!
I do not know whether you're in for suggestion, but would it be useful to distribute the objects with type, density, scale and rotation based on a map? Say a .png with an alpha channel: density read from alpha, scale from value, rotation from hue, type from saturation, or something like that?
FVerbaas posted at 7:34 AM Mon, 5 June 2023 - #4467187
Looks good!
Thank you.
The basics for maps are already implemented :)I do not know whether you're in for suggestion, but would it be useful to distribute the objects with type, density, scale and rotation based on a map? Say a .png with an alpha channel: density read from alpha, scale from value, rotation from hue, type from saturation, or something like that?
I thought I use RGB as channels and alpha to mark the ground. I think RGB is easier to handle. Others use groups as mask where to allow clones. But I think that's too rough in many cases.
Right now I'm trying to figure out when Poser says "now I need a few minutes" and turns a deaf ear. This morning I had a test running that was gasping for air for 2 minutes after about 200 props were generated. So far I haven't figured out when and why this happens.
The basics for maps are already implemented :)
Good!
I thought I use RGB as channels and alpha to mark the ground. I think RGB is easier to handle.
Maybe you're right. I named hue and saturation and value because of the similarity in function.
Others use groups as mask where to allow clones. But I think that's too rough in many cases.
Fully agreed. I made same comment to the others also.
Right now I'm trying to figure out when Poser says "now I need a few minutes" and turns a deaf ear. This morning I had a test running that was gasping for air for 2 minutes after about 200 props were generated. So far I haven't figured out when and why this happens.
Maybe faster to make one prop and just add to geometry, one group per clone. This would not burden Poser scene definition as much and also make scene management easier for the user. With the clones as groups in the prop geometry one can still approach and manage them individually, but also transform, delete, change texture of the whole lot in one go.
Maybe faster to make one prop and just add to geometry, one group per clone. This would not burden Poser scene definition as much and also make scene management easier for the user. With the clones as groups in the prop geometry one can still approach and manage them individually, but also transform, delete, change texture of the whole lot in one go.
This is definitely the faster method. However, it is also not as user-friendly because you can no longer edit the individual clones (correct position, set textures, etc).
Right now, I'm generating the props using Poser's Python methods and copying the textures using a set of functions I published a while back. This is pretty fast overall - significantly much faster than loading each prop with Poser's library functions, for example.
Despite the possible alternative (which I might include as a second option), I would very much like to know where Poser got the hiccup.
Another alternative is to generate an OBJ file directly. Then you don't have the problem that you don't get the groups generated (Poser doesn't allow groups in self generated props).
But before we discuss further about possible features: Would you be interested in helping with the implementation/programming?
Isn't this what the "Scatter Tool" does?
You can scatter 3D or 2D objects over 2D or 3D surfaces with or without surface alignment. It can create entire forests using billboard trees that use only 1 polygon that can render super-fast, and won't slow Poser down.
All of these examples were scattered over the default Poser GROUND plane.
Here's an example of scattering over 2D and 3D surfaces with surface alignment.
Surface alignment can be calculated even over morphed 3D objects.
You can even scatter figures of you like, with or without surface alignment.
The interface is very simple. Below is the new version for Poser 12 and 13, which added some new features, like scattering over custom areas we can PAINT with the Group Tool.
More examples of scattering in Poser 12.
Here's how you paint scattering areas with the Group Editor directly on the surface:
Create real-time CROWDS with billboards:
Each person is a single poly, so Poser won't even notice there is a 100 people on the scene. They auto-follow the camera, so they are always facing the right way for renders.
There is an older version for Poser 11 (Python 2), and a new one for Poser 12 and 13 (Python 3).
Hope this helps. :)
Characters, Body Sculpts, Morph Corrections, Outfits, Python Scripts, Universal Heads, and Videogames!
Isn't this what the "Scatter Tool" does?
No.
Your tool would be a start, if the source code would be available.
This is the Python forum after all. It's about coding by yourself. And learning. Less about buying.
Furthermore: Your tool is too slow to generate several hundred props. And you can't limit areas to materials or colors used there, or use the color scheme to manipulate the generated scatter props.
Whoever needs the tool like you offer it will have already bought it. There is certainly no need for the advertising here.
I certainly don't want to step on your toes, but: The goal is to develop the whole thing here publicly. Open source and the way users need it.
Folks, with all due respect, and trying not to heat up the conversation, I'd like to express my support for adp001.
This question of cloning objects is recurrent, and although solutions and workarounds already exist, there is certainly always room for improvement. There is still the issue of effective instancing etc...
I particularly use commercial solutions for modeling, texturing and others. But it's my preference, as I've learned and got used to that workflow, and it's still within my budget for the time being (which I hope to be able to maintain for some time to come).
Despite this, I think it's incredible and I will never criticize initiatives such as the Blender Foundation, for example, which popularized access to impressive 3D creation tools.
One area where I use open source solutions a lot is in web development, and I am extremely thankful it exists.
I think Ken's comment could certainly have been more subtle and respectful as it enters a thread that only seeks to help people. And a thread like this takes a lot of time for those who are participating / contributing. Especially the insertion of links and promotional images, as I doubt that everyone here reading this matter has not already known your solution.
Wow cool!@evargas: Thank you.
I have corresponded with user @FVerbaas and we have more or less decided to develop a "real" (
) scatter tool as an open source script here in the forum.
𝒫𝒽𝓎𝓁
(っ◔◡◔)っ
👿 Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
👿 Mac Mini M2, 16GB, 500GB SSD
👿 Nas 10TB
👿 Poser 13 and soon 14 ❤️
You guys would be surprised how many times I have seen people in the forums saying no scripts for Poser were ever made since Poser 12 was released. This probably happens because none of my script releases were advertised on the Rendo newsletter since 2020, and products get quickly buried on the store pages after a day or two, never to be seen again.
I posted here because I was told by another user that someone here was saying Poser doesn't have a script for scattering objects. I don't usually read the forums, so I took their word on it, and showed my solution for those who are interested - I didn't mean to intrude. Every now and then somebody points me to a forum where someone is asking for a specific script, and I show them what I have.
I find it both shocking and disappointing when customers can't find what they want in the store, and assume it doesn't exist. Happens quite often - especially when it comes to scripts. Seems like FINDING products at Rendo leaves something to be desired. Just wanted to put things in perspective before you guys jump to conclusions about why I posted here. I apologize if it seemed like an intrusion.
Characters, Body Sculpts, Morph Corrections, Outfits, Python Scripts, Universal Heads, and Videogames!
I have ken1171's tools and while good, there is always room for things with similar yet different functionality :) I like the idea of being able to paint on where the objects scatter which his does, but I miss the being able to just randomly scatter props from a selected directory (instead of having to be in scene) which some of the earlier scripts (https://www.renderosity.com/marketplace/products/106855/i13-f68-gardentime-landscape-generator-for-poser) did.
More choices is a good thing I believe :)
--------------------------------------------------------------------------------
Consider me insane if you wish, but is your reality any better?
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.
My first approach of a Python Script to the topic "Cloner". I needed something like that to create landscapes.
Important for me is the speed (what I have seen so far of such scripts for Poser, was not very convincing).
Currently my script generates 374 Poser props with a total of over 2 million polygons (5365 per prop) in 15 seconds, aligned on an uneven ground consisting of 374 polygons (on my old and small Dell Optipex Plus with I5 CPU; the machine I usually use for programming and not for graphical stuff :) ).
Preparations: From a Poser standard prop (Cloth Plane?) I made a "ground", which I deformed with the help of the Morph-Brush (ground waves).
In Blender I reduced a free object (plant) to a stem and adjusted the number of polygons drastically down. I then exported the whole thing as a wavefront file for Poser (scaled).
The result can be seen in the picture.
My script's first task is to provide a generator in the form of a function that returns the center and direction of each polygon as a coordinate and angle, respectively. The direction information is used to "plant" the generated plants vertically into the ground, so to speak.To make it look a bit more lively, the angle of rotation is randomly redetermined for each generated plant. Another step would be to randomly change the tilt angle a bit as well. For most objects, however, this will not be necessary (such as the plant shown).
For my needs, the script does everything I need at the moment. However, if there is interest, the whole thing can be further developed here in the forum as an "open source project". Above all a GUI is missing to make it usable for non-programmers.
If you are interested: Reply accordingly.