Hitfilm Parenting behavior discussion

edited February 2016 in Express Support

This video shows the behaviour in HF3Express, but you can load the project file at the link below into HF3P and HF4P and get the same result.

Download Project File

Background: I'd made one of the planes 3D, then deleted the camera, which reset the plane back to 2D, but it apparently thought it was still 3D and responded like this:  (that was a Red Herring, read later posts)

https://www.youtube.com/watch?v=2WSxHEjzcVs

[mod edit: update the subject based on the subsequent disussion]

Comments

  • AdyAdy Staff
    edited February 2016

    @Palacono - I've taken a look at the Project & I don't see a bug here. Your Layers have a non-uniform scale which makes it look like it's being manipulated in 3D when it fact it is not. 

    I have adjusted the thread title to reflect this.

  • @Ady What's non-uniform scale when it's at home and how is that behaviour not a bug?

    It doesn't do what I want it to do, which is to rotate around a single axis - because it's a 2D plane :)

    Did you watch the video to 51 seconds, where unparenting the plane makes it revert to 2D behaviour, but reparenting to the other 2D plane  makes it revert to it's 2.5D behaviour again?

    It might not be fully 3D (never said it was) but something's confused because it changes size when it reverts back to 2D when it's unparented, so is that because it got closer to the camera that isn't there any more?

  • When scaling a layer or plane make sure that you hold shift that way, the scaling is uniform.  If you look a the transform properties of your parent layer under scale,  that number has to be the identical  for the  x and y values. basically thats the issue  the  layers has to have an uniform scale.

  • edited February 2016

    @sd77 Have you watched the video? Can you replicate that behaviour with non-uniform scaling, especially at the 51 second mark?

    Best of luck... ;)

    Oh well, it's an interesting bug. Just be aware that if you make a layer 3D and move it, then delete the camera so the layer reverts back to 2D, weird stuff might happen. :)

  • edited February 2016

    I tried to replicate the behavior.   then I used  uniform scaling to solve the issue.   this is a not a bug. It is how the software supposed to behave.  In 3d software like blender and cinema 4d there are similar behaviors when parenting an object to another object and  the scale non-uniform

    here is the video     https://youtu.be/KdhLx_jfpSU

  • edited February 2016

    @Sdk7 Yep, you replicated it in the first 30 seconds and I stopped watching after that, and it didn't even involve a camera. It's a bug. :)

    Whether the plane is uniformly scaled or not, it is the size and shape it is in 2D and works as normal until you parent it. Parenting it to another surface and it then going loopy when you do something as outrageous as rotating it in 2D  isn't useful behavior in the slightest, and certainly not predictable.

    What would be useful is it rotating as if it was actually a 2D Plane while parented, which you can't actually get it to do. Good job that's not what I wanted then. Oh wait, it is what I wanted. :)

    There are other parenting bugs as well. I've recently parented some things to something else and the thing being parented has suddenly decided to change it's orientation instead of staying where the heck it was when I parented it.  :(

    More video of that coming soon too... ;)

  • @Palacono I'm pretty sure it's not a bug the software is doing exactly what you're telling it do. The behavior can be replicated without ever having a camera all you need is two planes. Changing values on the second plane after parenting can't be done in isolation because well it's parented and all manipulations are relative to the parent. Unparenting causes the second plane to inherit the relative values instead of its original native values. This all causes skewing when going with non-uniform scaling.

    To do what you want to do requires two points, one for each layer. Parent each layer to a point then parent the secondary point to the primary point. Use the points to do any rotations and positioning and you're free to do all the non-uniform scaling you want. 

    Going through all the math is beyond this forum (and me!) but there's a reason After Effects calls its points nulls. Computationally a null as opposed to actual or relative values avoids the behavior you are seeing because it really is a null value and is the primary reason AE implemented them to begin with.

  • edited February 2016

    @Ady , @Alladin4D , @Triem23 , @SimonKJones I don't think it's got anything do do with Nulls/Points; it's looking like the Parenting doesn't know how to deal with non-uniform scaling and makes assumptions about the scales being uniform when it copies them to/from the Parent to the Child during the Parenting or UnParenting process.

    As the presence (or not) of the 3D camera turned out to be a Red Herring, it should make tracking it down a bit easier.

    Simply Parenting and UnParenting should be completely reversible and non-destructive, which this video shows: it isn't always.

    Parent/Unparent enough times and you get an Oozlum Event, https://en.wikipedia.org/wiki/Oozlum_bird

    https://www.youtube.com/watch?v=0DvmMkYdH30

    I've also had other issues with Parenting when angles are involved, even when the scaling is uniform. Attaching 3D things to other 3D things - so I can move and rotate them as one - and when Parented: the Child changes its angle completely from the one it was before parenting.

    I was going to make a video of that (still might) but this surely explains where the developers need to be looking in the code? ;)

  • Aladdin4dAladdin4d Moderator
    edited February 2016

    @Palacono the difference between us on this is I would expect to see what's going on with the steps you are taking. I would expect parenting to enforce the traits of the parent layer on the child layer. If the parent layer has uniform scaling I expect uniform scaling to be enforced on the child layer even when the child doesn't have uniform scaling. Likewise if the parent layer has non-uniform scaling I expect its specific scaling ratio to be enforced on a child even when the child has uniform scaling or a different non-uniform scale ratio. When the scale ratios don't match I expect perspective skew on the child layer to make the maths work. I expect this because I can't think of any other way for scaling to work across a parent-child relationship i.e the parent scale traits must be enforced on the child otherwise you wouldn't be able to scale equally across a parent-child relationship.

    When the skew happens imagine a rectangle just large enough to encompass the object. Now imagine a second rectangle just large enough to encompass the parent object. The ratios of the two rectangles are now such that equal (uniform or non-uniform) scaling can be done across the parent-child relationship.

    Parenting and un-parenting doesn't revert values it transfers relative values. Each time you do it there's additive growth in the values being transferred. Object A has a value of 3. Object B has a value of 1. Parenting B to A generates a relative value of 4. Un-parenting transfers the relative value to object B making it 4. Parenting again generates a new relative value of 7. Un-parenting transfers the new relative value and so on and so on causing cumulative results.  

  • edited February 2016

    @Alladdin4D For that to be the accepted way of it working has got to be one of the silliest things I've heard. It has no practical value at all.

    The only way in which you get usable, reliable behaviour is when the scales are uniform; when it works as expected all the time. The behaviour you get with non-uniform scaling is completely useless.

    The way you describe the Parenting working isn't correct all the time. If you put a square next to a scaled square and their relative angles is 0 (i.e. they're both 'upright', although the concept of 'upright' should be purely arbitrary) then you can Parent and Unparent all day long and the values flip back and forth with no change. Changing the angle of either one of them and do the same thing and you will get the cumulative effect you described.

    So why does the angle make the difference? If it does make a difference, why isn't it consistent?

    It's bad enough in 2D that the angle changes the behavior, but in 3D where angles can be all arbitrary all the time, that means that for each axis for 359 degrees the results are unpredictable, and for one degree they'll do what you expect.

    For it to work the way it does, it would be more predictable if Hitfilm prevented you from changing the scales independently, and forced people to work with uniformly scaled models (which I guess 99% of people do, or they'd have found this before) because once the scales change: all  bets are off. But that would be silly; people would complain that it wasn't versatile enough. But the result is...sub-optimal. :)

    It's seems to me that the value of the angle when the parenting takes place should be stored and reapplied to the scaling values when further rotation or scaling takes place. The only way it currently works at all is because at 0 degrees difference you'd get the same result as if you did nothing (which is what it's doing now).  It's only because people have evidently not been scaling things non-uniformly then rotating them while parented that they've got away with it so far.

    It's the same problem as with text boxes. You make a small square text box and it has a centre origin point, but then you stretch it on one side. Does the origin move? No it does not. The origin stays where it was when you created it, which is now at one end. So now, to get it to rotate around the centre position you have to move the origin. But you could create a rectangular text box that is the same size as the one you just stretched and it's centre point is in the middle. If you set their positions and origins to zero, one rotates around the middle and one rotates around one end.  You have no way to make them identical with identical parameters.

    So, there are values that apply to text boxes that are not revealed to the user- and that one is particularly annoying as I never set the correct size of text box the first time and always have to adjust the origin to get it to rotate correctly around the centre after I resize it.

    Anyway, if that can have a hidden value that's used internally for text box origins, so can other things have other hidden angular difference values to correctly rotate things when they're non-uniformly scaled. ;)

    The only current solution is to simple not scale anything non-uniformly, which isn't really a solution at all.

  • Aladdin4dAladdin4d Moderator
    edited February 2016

    @Palacono ;

    "For that to be the accepted way of it working has got to be one of the silliest things I've heard. It has no practical value at all."

    Ummm never said it had a practical value, just a predictable mathematical value ;)

    "The way you describe the Parenting working isn't correct all the time. If you put a square next to a scaled square and their relative angles is 0 (i.e. they're both 'upright', although the concept of 'upright' should be purely arbitrary) then you can Parent and Unparent all day long and the values flip back and forth with no change. Changing the angle of either one of them and do the same thing and you will get the cumulative effect you described."

    Actually this is still what I would expect. Changing the relative angle after parenting introduces different axes giving you different results.

    "For it to work the way it does, it would be more predictable if Hitfilm prevented you from changing the scales independently, and forced people to work with uniformly scaled models (which I guess 99% of people do, or they'd have found this before) because once the scales change: all  bets are off. But that would be silly; people would complain that it wasn't versatile enough. But the result is...sub-optimal. :).......and the next paragraph......."

    For both paragraphs Point Layers are your best friend. Adding them does two things right off the bat  - It changes the order of calculation and the calculations are performed against a null. For your example all you really need is one point to parent to and everything changes working exactly the way you want it to. 

    No comments on the next 3 paragraphs at this time :)

     "The only current solution is to simple not scale anything non-uniformly, which isn't really a solution at all."

    Not true and two words - Point Layers.

    Last but not least this isn't all pure speculation on my part because I've seen similar behavior in other applications just like @sdk7 and apparently Ady which is why we are all saying everything you are seeing is expected behavior

     

  • edited February 2016

    @Alladdin4d , Yep,  Point Layers work. But, now they're an extra thing to have to remember if using non-uniform layers, which right up until you do, you'll never think about needing them, so will Parent (and Unparent, when you change your mind) things all over the place willy-nilly and it'll just work as expected (and-non destructively). But just scale one thing slightly non-uniformly and... WTH???!!!.

    It really doesn't explain why UnParenting messes things up and causes cumulative errors. I can see why applying the non-uniform scale one way causes a shape to deform, but why on earth can't it do the reverse maths properly? Why isn't it just like an Undo?

    That is still a bug, IMO. Can you explain why it isn't? IS there a practical reason for it to work the way it does?

    Another solution is to scale the asset outside Hitfilm to the new shape, so it's Uniformly scaled when you import it, then the maths works as expected again.

    Hardly well explained in the Documention anywhere, is it though?  Points are presented as a convenience, not a necessity.

    So what else works like this? AE, Blender? 3D Max? Other?

    Can you seriously not put two planes next to each other, scale one slightly, parent the other to it and rotate it without it going all bendy and as you Parent and Unparent it, it deforms more and more in any other software?

  • "It really doesn't explain why UnParenting messes things up and causes cumulative errors. I can see why applying the non-uniform scale one way causes a shape to deform, but why on earth can't it do the reverse maths properly? Why isn't it just like an Undo?"

    Parenting and Un-parenting always causes a transfer of values and yes it is destructive and pretty much has to cause a transfer in order to be a parent-child relationship. If you don't force conformance and transfer relative values then you don't have a parent-child relationship. It's not a question of practicality it's one of necessity. It doesn't work like an Undo because well, that's what Undo is for.

    I have seen this kind of thing in Blender. Lightwave and Cinema 4D and yes even AE which is why I started my part of this conversation by pointing there's a reason AE calls its points nulls. It is more common in 3D programs and before you say it yes I know we're talking about 2D planes here but HitFilm has a unified 3D engine just like 3D programs and I'm sure everything is calculated in the single engine. If it wasn't then you don't have a unified 3D space.

  • edited February 2016

    @Alladdin4d Just saying it's destructive doesn't explain why it needs to be. If something scales by 50%  on Parenting, then it should rescale back when Unparented. Ditto angle changes. Not doing so must mean something got lost somewhere. A divide one way should be cancelled out by a multiply. These aren't tiny rounding errors. I think no one's noticed this particular 'feature' because 99.99% of the time they use Points. Doesn't mean the code that handles it is correct though. We've all written code that works most of the time then falls over when it gets inputs outside what you expected. ;)

    And I didn't mean have those programs historically required you to use Nulls, but do they now for the same types of thing? And if you do the same things do you also get the same destructive results on the values when Parenting and Unparenting?

  • edited February 2016

     "So what else works like this? AE, Blender? 3D Max? Other?"  

    yes all of this programs work the same way.  In blender and others there is a way to applied the scale  making the objects uniform scale.  but this are 3d dedicated apps

    "The only current solution is to simple not scale anything non-uniformly, which isn't really a solution at all."  

    you could do what @Aladdin4d said which I believe is the proper way but you can also use a mask to create a rectangular shape. You can also when creating a plane layer set the width to be smaller than the height making a rectangular shape and and then hold shift to scale the layer. I think hitfilm is very flexible.  There are multiple ways to approach a problem.   

    "It really doesn't explain why UnParenting messes things up and causes cumulative errors. I can see why applying the non-uniform scale one way causes a shape to deform, but why on earth can't it do the reverse maths properly? Why isn't it just like an Undo?"  

    I think if you  right click on the layer and select reset . it will  reset the object to the original shape. but I am not sure if that if what asking.

     

  • "Just saying it's destructive doesn't explain why it needs to be."

    I didn't "just say" it was destructive I also said it pretty much has to be that way in order to be a parent-child relationship. If it isn't doing that then you don't have a parent-child relationship you have something else completely different that may or may not even work at all. It's destructive in the same way Sound Forge is a destructive editor i.e. there are many actions that cannot be undone by simply running the math in reverse. This is one of them like it or not. If you want to Undo then Undo which is a marvelous idea developed in part to get around situations just like this. 

    "And I didn't mean have those programs historically required you to use Nulls, but do they now for the same types of thing? And if you do the same things do you also get the same destructive results on the values when Parenting and Unparenting?"

    I have no idea and to be honest I don't particularly care because I learned early on not to waste time on actions that couldn't give me the results I wanted and moved on to taking the actions that did give me the results I wanted.

  • Well, I got tagged a few days ago, I guess I weigh in now. 

    The behavior shown is what is expected. As stated by others, this is what is expected in a parent/child relationship. As stated by others, it's better to rig points and parent assets to the points instead of direct manipulation of assets. As stated, rigging to points will isolate the asset from unwanted skew since the asset is isolated from direct mathematical transformation.

    I suppose in tutorials points are semi-presented as a convenience, but, yes, points are basically necessary. Certainly complicated rigs in Hitfilm, AE or Blender should all be done with points/nulls. First, this eliminates odd skews as in the original post of this thread, secondly because point rigs make is easier to change out elements or reuse a rig. 

    No, elements should NOT lose any inherited data when unparented! Hell, no! There are animation tricks that can be played with points that don't exist for an entire shot that would be impossible if inherited attributes were automatically zeroed out. Not to mention I have done some crazy model placements that required me to parent and unparent models to get the arrangement correct. Auto-reset of inherited attributes would have made it impossible. (Of course in Hitfilm 4 Pro I could now do the aforementioned setup with a grid emitter, but I didn't have the option in 3 Pro) 

    In short, Hitfilm's behavior on this matter still isn't a bug, is still what would be expected, and is still in line with the behavior of other, similar software. Palacono, sorry to say you're just wrong on this argument. 

  • edited February 2016

    OK, I know when I'm beat. :)

  • Thank you, all. That was educational.

Sign in to comment

Leave a Comment