Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
===========================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.
===========================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.
Any thoughts? If this can be worked out, the script may be worth posting. Otherwise, I'm not sure it will really prove useful....
===========================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.
I don't think I'm going to get any further with this concept unless I achieve some unlikely breakthrough in understanding vector math. So I'm going to go ahead and post these, so someone else can tinker with the idea if they so desire.
This first script sets up the poseable prop chain. To use it, create and select a hair room group before running the script. The script will create a prop chain which can be used with any selected hair group and the second script, assuming the hair group has the same number of vertices per hair as the one which was selected when the props were created. Run the first script, then pose the chain, then run the second script after re-selecting the hair prop.
===========================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.
===========================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.
===========================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.
Anyway, I just can't leave it alone. :-P I think I've found a way to get it to work. It uses one of my patented kludge-workarounds to avoid vector or matrix math. But now we're successfully extruding the hairs along the correct path.
I'm going to put a bit more work into this, after all. Some refinements and a few extra tools for the process, and this might make a useful hair room utility....
A couple of sample images....
===========================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.
I've added a gui to the script and merged the two above posted versions. My plan had been to avoid a gui, in hopes of making it Mac accessible, but my process grew too complicated for that. It was either a gui or 57 sub-scripts to be hand-loaded....
===========================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.
The gui still needs a bit of work. Right now it's confusing, with most functions hidden away in the file menu. There is an incomplete version of tube posing which uses rotation matrices. It isn't working yet.
For the time being, the main rotation function is a bit of a kludge, but it seems to work. Triangle props are created along the hairs and these actors are rotated to match the pose of the hair tube, so we can use the rotated tris to apply the correct location for the hair verts. Creation and deletion of the tris can be slow if you're working with a large hair group.
The "straighten along group normals" and "translate along group normals" functions both use the normals of the polys in the hair group of the parent object from which the hair prop was generated, in the hair room. If the parent prop lacks a group with the same name as the hair prop, the normals functions won't work.
The hair prop selection listbox looks for props with a parameter dial named "Dynamics" to decide what to display, right now. So it is possible to fool the script into selecting the wrong type of prop if a dial with that name is present in, for instance, a cloth prop in the scene.
So far so good, hopefully. I hope to add actual matrix math for the vertex rotations. It occurs to me that what's being done here is really a sort of low-grade skeletal deformation. The basic process, if the matrix rotations can be figured out, could perhaps be used to import a Blender figure or a .md5 model and pose it within Poser (applying the vertex weights), using a skeletal rig made of props. At the very least, perhaps a new sort of deformer system could be developed from this.
===========================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.
Well, fazz bazz. My "kludge" rotation method fails, now that I'm appying some more robust tests. So the core function of this script is not really yet in place, and the script as posted above is still knackered. My apologies to all two of you who are following this thread. :-P
3D rotations are tricky beasts.
===========================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.
I find the hair room design tools impossible to use effectively. Poser has never been very reliable, in my experience, when it comes to anything that requires dragging the mouse through the preview window to position an object. In order for the hair room to be useful for me, it will require better tools. Less awkward interface dragging and more numerical inputs, say. Or better interface dragging. :lol:
Unfortunately, the effort I made in this thread (some years ago now) quickly ran up against my limited mathematical knowledge and ability. I'm self-taught (no math education beyond algebra and basic geometry) and, sadly, I've never been able to master any math which involves rotations. The script in this thread was ultimately all about rotational math. :sad:
If anyone with more ability wants to tackle the idea, it would make me very happy. Unfortunately, I took this as far as I could, which wasn't far enough for it to be useful. This script represents an area where Python could presumably help make Poser a better program.
===========================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.
Hello,
how about marrying polygon hair and strand based hair?
There is plenty of polygon based hair out on the markets, and it is complex and has a lot of styling. It lacks good shaders / textures, they often have a lot of burnt-in specular and are not very realistic.
Some of the polygon hair items may be suitable for the following approach. I noticed that often, the same maps are used for all materials. The uv mapping is often done such that the hairs in the texture maps are eith parallel to the u or the v gradient.
If one could now obtain the uv mapping from this polygon hair, grow strand hair on top of the polygon hair, and direct the guide hairs along the u or v gradient, such that the guide hairs essentially follow the polygon hair surface. Then the strand hair would cover the polygon hair to a large extent and could provide the appearance (with the texture maps of the polygon hair still in the background to avoid bald spots).
Don't know if this would be too complex to implement (and if it would look good at all, given the guide hairs have been positioned as described).
Best regards,
Michael
I would love to be able to easily derive dynamic hair from polygonal hair. It hadn't occurred to me to use the UV mapping of a hair set to try to determine the proper flow for the hairs. That is an interesting idea.
There are complications I can imagine at the outset. Poser dynamic hair has a very special relationship with the scalp prop or skullcap to which it is attached. There are potential problems in dealing with hair groups and hair root positions on the scalp prop which might interfere with the ability to effectively automate any kind of polygonal-to-strand conversion for hair.
But the basic idea is good, and it's something I'll think about. Not sure offhand how it could be implemented, but maybe something will click and the idea could lead somewhere. :laugh:
===========================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.
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.
So I'm working on this script. Right now it succeeds in positioning the hairs along a path defined by the positioning of a series of parented props. But each of the hairs literally follows the path, so all of them end up with the same shape and the hairs tend to overlap. See the images in this post and the following ones. I think something needs to be worked out to position these hairs as a group, relative to one another, but I can't seem to work it out. I've tried all sorts of offsets and adjustments, but nothing's really quite right.
So I thought I'd ask here if anyone has any thoughts. How can these hair verts be made to follow the path as a group, so they retain a certain distance from one another and don't collapse into a plane or cross that plane and overlap like this? Any ideas? Hints?
===========================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.