Can Poser's STRAND Hair be saved as an object?



  • I know the hair is supposed to be dynamic, but the strands DO have vertices on them. If they were saved as objects, couldn't they be manipulated with Poser's morph brush?


  • Poser Ambassadors

    Not sure. The strand hair is not made of polygons. They're just line segments.

    I seem to recall seeing a script that created 3d tubes from those segments, which then could be manipulated like any prop. Perhaps it was by Snarlygribbly?



  • @bagginsbill said in Can Poser's STRAND Hair be saved as an object?:

    Not sure. The strand hair is not made of polygons. They're just line segments.

    I seem to recall seeing a script that created 3d tubes from those segments, which then could be manipulated like any prop. Perhaps it was by Snarlygribbly?

    Hmm, well, they are still supposed to be dynamic. I wonder if the gravity script in the Python menu would have any effect?



  • @eclark1849 The Morphing Tool can't create a new Custom_Morph on the guide_hair prop. This is possibly due to there being no facets defined for this prop, only line segments, as @bagginsbill noted. For the same reason, the Grouping Tool can't touch the guide hairs, as it's base unit of operation, groups, are defined by facets, and single vertices or line segments don't qualify as facets, so can't be selected. If there's any shared code between the two tools, (pure speculation here) that may be a stumbling block.

    The gravity script operates on the prop's translation of it's origin, not the individual vertices.

    The guide hair prop is actually saved as an internalised object definition in the .pp2 file. I've just run into the problem of breaking the populated setting when loading a hair prop and it's base object after cutting out the object definition and removing it to a .obj file, which Poser didn't seem to be able to deal with, for yet to be determined reasons.

    0_1522805117304_Screen Shot 2018-04-04 at 10.50.01 am.png

    With the guide hairs extracted to a referenced .obj file, Poser wouldn't re-populate the hairs after loading, and only deleting the growth groups and regrowing them would restore functionality in Poser. There was no problem if I left the object definition within the hair prop file itself upon loading.



  • Kawecki's dynamic hair convertor makes each strand into a thin ribbon. I haven't used it in anger, but it seems to work:

    http://www.sharecg.com/v/27296/gallery/10/Software-and-Tools/Dynamic-hair-converter



  • I've tried the converter. It's hit or miss if it works. I've had some hair that it works ok for, others the figure is practically bald with either sparse hair (looking similar to the preview picture) or not all groups being converted. It's also quite poly heavy.



  • What I'd like to see and learn is just how is Poser's strand hair defined and how it works. I'm just starting out with Python, of course, but I'd ultimately like to create a control module for the hair room that would give people greater styling control over the hair. like creating a comb, brush and scissors.



  • I don't know if you'll be able to create those. when Cage was working on his hair to path script, he said Python didn't provide access to the hair styling tool functions and it lacked support for mouse interactions with the 3D space. Now that being said, I don't know if it was true or if Cage had limited knowledge. I don't know python from a snake.



  • @redphantom said in Can Poser's STRAND Hair be saved as an object?:

    I don't know if you'll be able to create those. when Cage was working on his hair to path script, he said Python didn't provide access to the hair styling tool functions and it lacked support for mouse interactions with the 3D space. Now that being said, I don't know if it was true or if Cage had limited knowledge. I don't know python from a snake.

    All I'm qualified to say is that Cage is way better at Python than I am. Given that my skill level is rudimentary, that may or may not be a convincing testimonial. :)

    The hair_to_path script that @redphantom helped to test is available here: http://www.morphography.uk.vu/~cagepage/looper/loopy.html in case you want to study it, @eclark1849.



  • @redphantom said in Can Poser's STRAND Hair be saved as an object?:

    ...or if Cage had limited knowledge.

    I think we can definitely attest that to be not the case



  • @amethystpendant Can the strand vertexes be deleted, either individually or as a selected group? I know this is getting into modeling territory, which, technically, Poser doesn't do.



  • @eclark1849 Certainly NOT with python, you could probably do it with the group editor but that hasn't been exposed via python, grrrr



  • @amethystpendant said in Can Poser's STRAND Hair be saved as an object?:

    @eclark1849 Certainly NOT with python, you could probably do it with the group editor but that hasn't been exposed via python, grrrr

    Okay, is there someone we can pester or threaten to allow this? :)



  • @eclark1849 said in Can Poser's STRAND Hair be saved as an object?:

    @amethystpendant said in Can Poser's STRAND Hair be saved as an object?:

    @eclark1849 Certainly NOT with python, you could probably do it with the group editor but that hasn't been exposed via python, grrrr

    Okay, is there someone we can pester or threaten to allow this? :)

    If you are organising a posse I'm sure @anomalaus will join me



  • I hadn't meant to imply Cage didn't know what he was doing. I just don't know him well enough to judge. He does seem very capable.

    You can't use the grouping tool on the hair strands.

    Count me in on any posse to encourage any hair room\ strand hair usage improvements.



  • @redphantom said in Can Poser's STRAND Hair be saved as an object?:

    I hadn't meant to imply Cage didn't know what he was doing. I just don't know him well enough to judge. He does seem very capable.

    You can't use the grouping tool on the hair strands.

    Count me in on any posse to encourage any hair room\ strand hair usage improvements.

    This posse is for exposing UI capability in Python, we can get the pitch forks and torches for dynamics :)



  • @amethystpendant said in Can Poser's STRAND Hair be saved as an object?:

    @redphantom said in Can Poser's STRAND Hair be saved as an object?:

    I hadn't meant to imply Cage didn't know what he was doing. I just don't know him well enough to judge. He does seem very capable.

    You can't use the grouping tool on the hair strands.

    Count me in on any posse to encourage any hair room\ strand hair usage improvements.

    This posse is for exposing UI capability in Python, we can get the pitch forks and torches for dynamics :)

    But exposing the UI will allow for more tools to be made for the hair. And anything to improve poser overall is good.



  • @eclark1849 This is strictly from my experiments with Posers Strand hair and may not be 100% correct, however all my testing says it is. The hair is composed of lines, not polygons. What that means is there is a point on the base object and then a distance away is the next point and so on. The number of points is based on the number of segments you define. The distance between points is also a calculation based on segments and requested length. During the render of the hair a polygon is created that makes a flat polygon with the correct amount of taper from the base to the tip. Each pair of points define the ends of the polygon. These Polygons which act like billboards are programed to point towards the camera to the best of their ability (given that the curve of the line may make that impossible for some segments to do). The biggest problem with this is that none of the tools will effect the points. You can only grab the tip of a hair and move it around and adjust the distance down the hair the movements will travel. Since the billboards are created on the fly they probably do not have a proper UV map applied so you cannot map images to them (conjecture) that produce predictable results.

    Nerd talked about them trying to improve the hair in the current version, however it was to complex to get the results. Now total conjecture on my part. I think they went about it the wrong way and were trying to improve the billboard aspect of the shading and that will fail since it is a flat surface and hair is round. This will not do a proper Angle of Incidence without a ton of math trying to get it right. What I have suggested (on this forum) is that instead of making flat billboards that they take each point and make it into three (triangle) between each point (pair of triangles) make a polygon face between any four of the points. This would result in a triangle tube. As long as the tube has no endcaps then you can apply subdivision to the tube and it will get rounder and rounder and have a better AoI. If you make a tube of faces then you can apply a proper UV mapping which will allow for all the nodes to be used to color it. Also as soon as it has polygons then the current morph tools will be able to move it about. The only issue and it is not really that big a deal since the current hair room makes clones of the guide hairs is to clone all those tubes and shatter them.



  • @richard60 I'm listening to you tell me one thing, but the reference manual is telling me the opposite. You CAN control the tip, but you can also control the verts in each strand by using the kink controls. Less kink, smoother hair.



  • @eclark1849 I can't even get the Morphing Tool to highlight vertices after forcibly creating a morph on the guide hairs prop using:

    scene = poser.Scene()
    growth = scene.CurrentActor()
    geom = rmh.Geometry()
    growth.SpawnTargetFromGeometry(geom,'NewMorph')
    

    since the Morphing Tool just does nothing if I try to create a new morph on the guide hairs prop.
    It works perfectly on the growth group prop, as expected.

    [Above was an unposted response, due to an overnight date with Morpheus]

    I suspect, but don't "know" (without seeing the code) that Hair Styling is restricted to translation of endpoints, with optional restrictions to preserve overall length, and (the point of my suspicion) parametric application of that translation to the intervening points on each styled hair, based on it's index (the proportion of the vertex's sequence from root to tip) and some gain factor (so the hair bends, rather than remaining linear). All of the guide hair vertices (which can be added or removed simply by changing the number of grown segments from 2 to too many) are exposed in the sense that their position is defined in the object definition. Therefore they can be manipulated my python in only a brute force method, currently. That is: get the geometry, calculate any vertex position changes required (including "styling"), manually write a new hair prop file including base growth prop, then reload that prop from the library to replace the previous file.

    If there is no simulation required (not a normal scenario, but easier to test), everything I see in the files shows me that the hair styling is only recorded as vertex position changes in the guide hair object definition. I'm not sure yet whether that includes incorporating the effect of the kink parameters in the vertex positions, as my recent test case turned off the kink completely. I believe the kink controls calculate a parametric displacement (vertex translation) of intermediate vertices on each hair. I will have to check whether that calculation is saved into the resulting object definition, allowing the hair to be loaded, fully styled from the library, without having to revisit the hair room. Dynamics can be recalculated manually at any time, creating new .dyn (legacy) or .abc (bullet) files, IIRC.

    The guide hair object definition shows the exact, expected relationship between the number of hairs (elems, composed of line segments) and the number of vertices (verts), being: verts = elems x vertsPerHair. Each guide hair grows from the centre of a facet of the hair growth group on the base prop (I think).

    @eclark1849 the manual is not contradicting @richard60 , since the kink controls are providing a parametric translation of the intermediate guide hair vertices, not an arbitrary translation selected by the user. The kink is a parametric formula, strictly applied to each vertex of the hair, not a morph of the vertices.

    [Engage untested speculation] Unfortunately, being a hairProp object type, I'm sure this precludes the application of actual morphs to hair vertices. Poser just won't apply morphs to hairProps. [Test speculation] WELL, butter me biscuits. Here's a shot of a deformer spawned morph on a hairProp. This changes everything. You want hair styling? Just create the morph you want! (Though I don't yet know how it will interact with dynamic simulations, if it gets morphed first, then simulated, it's all good!)

    0_1522900186484_Screen Shot 2018-04-05 at 1.46.33 pm.png

    Of course, when I say "just create the morph you want", I mean find a way to define which vertices have which translations and write a python script to calculate and create the styling morph. Easy X-P..., or not...