Summary

Title:Conversion between guides and splines are not 1:1
Category:Workflow
Status:Open
Posted By:baothebuff ( )
Date Created:7 June 2015

Problem

Description:

When converting guides to splines, the number of segments does not remain the same thus changing the overall shape of the spline.  This also happens when converting a spline to guides with oxGuidesfromShape.  It is very important that everything remains consistent when converting from one to the other we like to do this a lot and what happens now is that it's changing our hair shape.

 

- Tom

Steps to Reproduce:

add oxGuidefromSurface to a plane.  

set guide segment to 10

add editSpline to stack

result - segment count changes.  

 

Attached Files:
Image 1

Seems odd that the spline is of type "corner" where as it should be generated with the bezier handles in place, which is also why every 2'nd point is skipped.

I just tried it on my computer and the generated splines are smooth so I cannot confirm this problem.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Thanks for the reply Marsel but I think may have not explained it very well.  Even with the bezier handles in place, the shape is not the same.  I've attached another image to illustrate what I mean.  Even this little difference gets exponentially multiplied if you keep doing guides -> spline then spline -> guide conversions and that can dramatically alter the original groom.  Therefore it is important that any conversion has to produce the EXACT original curve if you keep the segment the same.  

Thanks,

Tom


Attached Files:
Image 1

Hi Marsel, were you able to confirm this issue?

-Tom

Hi Tom,

Yes I do understand the issue. I don't think it is possible to get a 100% match in terms of vertex positions when going to spline and then coming back, especially if the number of points is changed. The only way I can think this is possible is by placing a knot at every hair vertex but that would create pretty complex splines if there are many vertices. I will have to play around with the settings of splines to see if that is a viable option.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

I was investigating this a bit more and I think the only way to guarantee that the shape of guides doesn't change after spline conversions is to export them using per-vertex corner splines. But that might beat the purpose of converting to spline in the first place.

Tom, can you please let me know what is the purpose of converting to spline in your workflow? Maybe that could help me find a solution that works for you.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Hi Marsel,

I generally like to collapse my guides into splines for a few reasons:

1) so I can edit them at the vertex level

2) run scripts on the splines

3) do multiple versions of hair and morph them together, mix match different areas

4) reuse the same spline sets for multiple characters

5) deliver as editsplines for simulation purposes

6) simply collapse them down to simplify the stack

 

Maybe have an option on how splines are outputed?  SplinesFromStrands mod similar to what meshfromStrand does, or roll it into that same modifiers as one of its options, where you can specify smooth or corner as is spline output.  

when converting from splines back to guides, there should be an option to use the splines as-is without any smoothing or segment change also, that would enable a 1:1 conversion.  

It's a tricky issue but I think it's an important one to address.  I'd love to hear your thoughts.  

 

- Tom

Hmm, indeed, I suppose a separate SplinesFromStrands modifier is needed to expose the controls for how knots are generated. And GuidesFromShape modifier should then also offer an option to just import each knot as is, as you mention. That would solve the problems you're having I hope.

Marsel Khadiyev (Software Developer, EPHERE Inc.)