How does "Fit To" work?

I was wondering what is the algorithm behind the "Fit to" function. From what I can tell it's a "Point At" type of method where the End Point of one bone points at the End Point of its counterpart. The Origin points don't seem to be affected. Is this correct?

Comments

  • Yikes, well the way I understand it is that FIT-TO uses templates (pre-made weight mapped articles of clothing) that it transfers weight maps from to the "new" object.

  • Faux2DFaux2D Posts: 452

    You're talking about Weight Map transfer which is not part of the Fit To function. You can fit an item to a parent figure with zero weight maps no problem because it's about moving the bones around. This happens whether or not weight maps exist.

  • ParallaxCreatesParallaxCreates Posts: 467
    edited May 2020

    You're talking about Weight Map transfer which is not part of the Fit To function. You can fit an item to a parent figure with zero weight maps no problem because it's about moving the bones around. This happens whether or not weight maps exist.

    Ok, well seems like you have it all figured out. laugh

    In case you need some more info, you could always give this a look over Mr Wuzzums.

    http://docs.daz3d.com/doku.php/start?do=googlecustomsearch&id=fit-to

    Post edited by ParallaxCreates on
  • Faux2DFaux2D Posts: 452

    I haven't figured it out because I still don't know how it affects the Origin and End points of bones, hence this thread.

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,495

    well it looks for certain bones that match the target figures bones and if it doesn't find them it brings up autofit

    namely base figure name then hip etc going down to the body part it is meant to fit to

    changing scene identification on hairs before fitting enables them to keep their bones for this reason but it might not line up to a head if too different 

  • Faux2DFaux2D Posts: 452

    well it looks for certain bones that match the target figures bones and if it doesn't find them it brings up autofit

    What happens when the bone setup is identical but the bone position are different? Like Bone_A si a parent to Bone_B which is a parent to Bone_C. When the fitted figure has Bone_A, Bone_B, Bone_C but their positions are misaligned, does Bone_A change its position (source and origin points)? If so does Bone_A's position change affect its children bones or does each bone regardless of parentage get their Origin and End points changed to match the source figure?

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,495

    well it looks for certain bones that match the target figures bones and if it doesn't find them it brings up autofit

    What happens when the bone setup is identical but the bone position are different? Like Bone_A si a parent to Bone_B which is a parent to Bone_C. When the fitted figure has Bone_A, Bone_B, Bone_C but their positions are misaligned, does Bone_A change its position (source and origin points)? If so does Bone_A's position change affect its children bones or does each bone regardless of parentage get their Origin and End points changed to match the source figure?

    well then the clothes don't line up

    thats why the clothes need to be fitted and this really only works for hairs and conformed props

  • Faux2DFaux2D Posts: 452

    well it looks for certain bones that match the target figures bones and if it doesn't find them it brings up autofit

    What happens when the bone setup is identical but the bone position are different? Like Bone_A si a parent to Bone_B which is a parent to Bone_C. When the fitted figure has Bone_A, Bone_B, Bone_C but their positions are misaligned, does Bone_A change its position (source and origin points)? If so does Bone_A's position change affect its children bones or does each bone regardless of parentage get their Origin and End points changed to match the source figure?

    well then the clothes don't line up

    I'm interested on the bones alone. The geometry won't match but the bones do.

    The problem I'm having is that I have Figure X, and it has cascading setup: Bone_A -> Bone_B -> Bone_C -> etc. I copy Figure X, change the position of each bone (as in the Origin and End points), memorize the figure, then I fit the original Figure X to its copy. All bones move according to the source figure except the first bone always goes wonky. I can't tell if its rotation is messed up because the Fit To algorithm aligns the last bone in the sequence properly and then the first bone has to compensate.

    An analogy would be a wire you want to attach to an Anode and Cathode. The distance between the Anode and Cathode is 10cm. Your wire is 11cm. Connecting it would make it fold in an area, it won't be a straight line. This is what I'm trying to figure out, if Fit To changes the bone length (the Origin and End points) when aligning them with the source figure. And if it doesn't then that means some buckling has to happen in the bone sequence, in which case I want to know where this bucking appears: the first bone in the sequence or the last bone?

  • Richard HaseltineRichard Haseltine Posts: 102,292

    Fitting essentially expects that the bones will match - you can have additional bones (for tails in hair, for example, or for the ribbons on a piece of clothing) and you can stop the hierarchy early (not having the leg bones in a skirt for example) but only bones that match in name will follow the pose of the base figure and generally only those that match in centre point will follow productively.

  • Faux2DFaux2D Posts: 452

    I just want to know why the buckling happens in a bone chain in the fitted figure.

    Please have a look at the attached image. Figures are copies of one another, one has had Adjust Rigging to Shape applied to it, then the original (Fig. B) was fitted to it. The buckling happens because the bone lengths are not equal. I want to know why this happens as in what's the underlying algorithm that drives the Fit To function which ultimately creates the buckling. As you can see this buckling happens in the first bone in the bone chain. This tells me the first bone is misaligned to its source figure counterpart. Why? Why do all the other bones in the chain follow their original source figure counterparts but not the first one?

    why buckling.jpg
    2424 x 804 - 412K
  • Richard HaseltineRichard Haseltine Posts: 102,292

    If you want different bone lengths then use new bones that are not in the base figure. I am finding it hard to follow your image and description, but if the joint centre is offset while the weights aren't then the mesh that is modified will usually kink or buckle as it is in the wrong place relative to the centre of rotation - this is why rigging may need adjusting to accommodate a morph.

  • Faux2DFaux2D Posts: 452

    I don't want bones of different lengths, I only want to know the algorithm behind the Fit To function. Sorry for the mispelling in the image.

    Does it snap the Center Points of the bones of the fitted figure to their counterpart in the source figure? I can see that the Center of the first bone is snapped however the later bones are not. Does the code say somewhere to just copy the Center point of the first bone but then ignore all other bones and just ad a Point At feature to them? If that's the case there should be no buckling. This means it also has to snap the last bone in the chain. Looking at the effects it seems it snaps the End point of the last bone and not the Center. Why the buckling happens in the first bone I can't tell. It might be it has no Point at modifier, or its Point At modifier is somehow different.

    This is all inference from the effects I've seen but I can be completely off the mark.

  • I haven't figured it out because I still don't know how it affects the Origin and End points of bones, hence this thread.

    What are you making? What is it? What is the object? Lets start there because that ultimately helps facilitate helping you. There are different workflows for different meshes and rigging needs, please reveal the mystery of the object you are trying to rig in Daz and once that is done I am sure Richard or anyone can immediately advise you how to remedy the issue you are having. I rig all my jewelry products from scratch thus I control all the behavior of all the bones. You may want to rig from scratch rather than use the FIT-TO feature. Yes it may be more work, but you will have all the control. 

  • Richard HaseltineRichard Haseltine Posts: 102,292

    The centre points and orientation of matching bones need to match - fitting doesn't do anything to the rigging in the sense of changing properties.

  • Faux2DFaux2D Posts: 452

    The centre points and orientation of matching bones need to match - fitting doesn't do anything to the rigging in the sense of changing properties.

    Ideally they should match but practically they do not need to. The starting joint's Center Point jumps to the Center Point of its counterpart of the source figure wherever it may be. I'll call this starting bone Hip. The Hip of one figure is at zero on the X axis, let's say. If I fit it to a figure which has the Hip at X +20 then the Hip in the original figure jumps there too.

    I have attached images as examples.

    Image A: It's a basic Genesis 2 male figure, no changes to its rigging.

    Image B: Genesis 2 figure with a modified Hip. The Center point of the Hip bone has been changed from zero to +20 on X axis. Then the rigging has been memorized.

    Image C: A third Genesis 2 figure. The Center Point of the Thigh joint has been changed, then the rigging memorized.

    Image D: Original G2 figure fitted to the G2 with the modified Hip. We can see that the Center Point of the Hip of the original G2 now coincides with the Center Point of the Hip of the modified G2.

    Image E: Same as before except the original G2 is now fitted to the G2 with the modified thigh. We see no change in the Center Point of the original G2 figure.

    Image F: G2 with a modified Hip. Both Center and End Points have been modified, essentially changing the bone's axis. Rigging has been memorized

    Image G: Original G2 fitted to the G2 with the modified Hip axis. The Center Points jump as expected but the end point stays the same. This is what I'm trying to understand. Why does the End Point of the starting bone of the fitted figure not change?

    We can also see the buckling effect in action. The bones on the right side of the body try to extend to reach their counterparts. On the left side they buckle to keep the End Points of all the final joints aligned. Joints like the last phalange on the hand, etc. These bones hardly ever move but the bones higher in the hierarchy buckle.

    Again, I need to know why the first bone always acts wonky. Why does it snap its Center Point and not its End Point. The Buckling effect can be mitigated a lot if this first bone changes it's axis apporpriately.

     

    I haven't figured it out because I still don't know how it affects the Origin and End points of bones, hence this thread.

    What are you making? What is it? What is the object? Lets start there because that ultimately helps facilitate helping you. There are different workflows for different meshes and rigging needs, please reveal the mystery of the object you are trying to rig in Daz and once that is done I am sure Richard or anyone can immediately advise you how to remedy the issue you are having. I rig all my jewelry products from scratch thus I control all the behavior of all the bones. You may want to rig from scratch rather than use the FIT-TO feature. Yes it may be more work, but you will have all the control. 

    One of my testing figures has 900+ bones. Another has 400+. Showing the full rig would have made you more confused. I tried my best to simplify the problem.

    A.jpg
    1920 x 1048 - 665K
    B.jpg
    1920 x 1048 - 686K
    C.jpg
    1920 x 1048 - 698K
    D.jpg
    1920 x 1048 - 705K
    E.jpg
    1920 x 1048 - 718K
    F.jpg
    1920 x 1048 - 731K
    G.jpg
    1920 x 1048 - 748K
  • Richard HaseltineRichard Haseltine Posts: 102,292

    The centre point of the root snaps because that is the root from which the hierarchy grows. But never mind fitting, what happens twhen you try posing your modified figure? Moving centre points without modifying the weights is always going to give strange results. Why are you wanting to do this in the first place?

  • Faux2DFaux2D Posts: 452

    I have made another thread about it a while back but I was just testing it then. Now I've met with the starting bone issue.

    Image 1: The base figure.

    Image 2: The modified figure. I used Marelous Designer to simulate leather on the mesh. Imported it as a morph, then adjusted the figure's rigging to the new shape.

    Image 3: The base figure fitted to the modified figure. You can see an issue with the first bones. Because of the number of the bones the fitted figure can mimic the simulated morph quite nicely but the first bones messes up and creates unwanted results.

    The flow of geometry mimics the flow of the bones specifically to circumnavigate this issue. If the first bone would change its axis like all its children do in theory you wouldn't even need a hierarchycal setup.

    1.jpg
    1920 x 1044 - 719K
    2.jpg
    1920 x 1044 - 790K
    3.jpg
    1920 x 1044 - 780K
  • Faux2DFaux2D Posts: 452

    But never mind fitting, what happens twhen you try posing your modified figure? 

     

    This method will be used for clothing only. A human figure will be used to create the appropriate morph of the piece of clothing through Marvelous Designer (MD). Then that morph will drive the posing of the piece of clothing in Daz Studio. The item of clothing will never be fitted to the human figure.

    With this method I can create let's say a very complex piece of armor. Using MD, which is just a physics engine, on the armor will lead to bendy unwanted results. But if I create a placeholder armor, I can use MD on it, then create a morph to be used in Daz. The actual armor will be fitted to the placeholder armor in Daz which will lead to no distortions, and will be realistically accurate.

  • Faux2DFaux2D Posts: 452
    edited May 2020

    I figured out a workaround of the first bone issue which is to create a sibling bone, then reparent the original bone to the sibling bone. The sibling bone will then get the wonky effect but it's not attached to any geometry so it's good. The effects are better if you add one or two child bones to the sibling bones, then reparent the original first bone to one of them.

    The image attached shows the posibilities this method has. The chain is attached to a bone in the hierarchy of the boot bones relevant to its position. The boot in images B and C has zero morphs, that's just posed. The purpose of Marvelous Designer is to pose the 400+ bones for me and because of this large number it can mimic cloth very well in Daz. 

    The chain is just an example of geometry you don't want to get morphed and can be anything else including continuous geometry on the original figure. You can even add thickness to clothes and have them behave like it's a single sided polygon. 

    Untitled-1.jpg
    1872 x 948 - 538K
    Post edited by Faux2D on
Sign In or Register to comment.