Author Topic: Models won't rotate properly when animated  (Read 4022 times)

0 Members and 1 Guest are viewing this topic.

Offline SeanHeaney

Models won't rotate properly when animated
« on: March 18, 2021, 09:50:17 am »
Hi there,
I am trying to animate some pens that I modelled to roll across the scene. The pens are already animated to move across the screen but I also need them to rotate on their axis to look like they're rolling. When I try to do this it doesn't acknowledge any pivot point that I use in the model and rotates in very unexpected ways in massive circles or in multiple axis. When I go to rotate the part in the 'more model' section it rotates around the axis that I want perfectly. I have messed around with every setting possible and changed the pivot point to multiple parts of the pen with no solution. Please help!

Offline andy.engelkemier

Re: Models won't rotate properly when animated
« Reply #1 on: March 18, 2021, 01:04:37 pm »
Keyshot's world rotation is really getting you.
Your structure should look like this:

Main Group >  (you can do your movement and angle here, but that's it)
    -Marker group (you can translate this, but do not rotate it)
         -marker pivot object (this defines where you'll rotate the marker)
         -marker rotation group (This is the one you will rotate, and it will point to the pivot object. Do not translate this group)

Since keyshot has wonky transforms you have to set up your groups carefully to avoid issues. Group your object twice, one for transforms, and another for rotation.
The reason it's so wonky is the user doesn't actually know if those numbers are world or local. Realistically, if you have an object selected and it is a child, they should be local. But if you adjust a number there, you'll see your part Fly off into the distance if you have several translations and rotations to set up your scene. And you can't undo!!!!
So if you ever feel like adjusting one of those numbers there, Save First.

Offline theAVator

Re: Models won't rotate properly when animated
« Reply #2 on: March 18, 2021, 01:38:50 pm »
Can you provide the file for us to look at and see if there's anything major that sticks out?

At the very least, can you show your animation properties window - what you show in the screen shot has all of the position and advanced properties collapsed. Having those available might make it easier to point to a solution.

Offline SeanHeaney

Re: Models won't rotate properly when animated
« Reply #3 on: March 18, 2021, 10:05:47 pm »
Hi there, thanks for the fast replies! I was going to group everything but that would require me re-labelling everything (because putting things in groups messes up all labels) which is the last resort I'm my eyes. I will try that if all else fails. I have attached the keyshot 10.1 file and the labels if you guys could have a look that would be great help... I did set all the rotations to local in their own settings and even tried out the same pen rotation in a separate file with no translations and 1 pen.

Offline andy.engelkemier

Re: Models won't rotate properly when animated
« Reply #4 on: March 19, 2021, 07:02:02 am »
Order of doing things makes a difference when working from planning - cad - rendering - output. And where you started in a bad place is the CAD model isn't at zero. If you actually need to use labels on models, that will help.

The next is, labels are used if they cover a portion of your material. You aren't using your material at all because you are 100% covering your material with your label. So in that case, just put the texture map in the diffuse. If you open up the material graph it probably makes more sense. There you see that a label is really just another material on top of your base material, and in your case you have a texture map in the diffuse. But if you have nothing in opacity, then you're just completely covering the material below it.

Another, and I know you probably aren't finished with scene setup, is if you have a physical surface for the ground, turn off ground shadows in the environment. Also don't use the default environment, ever. I won't get into why, just trust me on that one.

Any way you look at it, you're in for some work that is going to take some time.
But to start off, you can use the "thin tip" part as your pivot object using the Y axis.
And that starts off the crappy part. You've got to add that to Each marker One at a time.
This is one Really good example where you have a GIANT advantage doing your UV editing in the software you are using. I use Rhino and blender mostly, so I'd do it there. When keyshot imports the model, it will already have the texture you used applied, and as UV map. Because yes, as you group things, keyshot messes everything up, it sucks. I wish it worked on only the immediate group it was in when you choose "model", but it doesn't. And when you choose Part, it doesn't move with the model. So when you animate the whole thing, you get this crazy floating look.

Also you Really only need one label if it's covering the whole thing They are all the same, other than color. So just save it with the color area transparent from photoshop. Then you can change the color of the marker in keyshot based on the material and you only need one material. That's faster than having the change the texture on each one. Set up one, change color. Duplicate, change color, etc. Less clicks, and happens faster. There are some tricks to copy and paste your color codes from hex, or bring in a pallet as well to make adding those faster.

Looking at what you're up against, I would be inclined to start over on the marker aspect. In order to get the marker rolling, you need to either use UV's from the model itself, I'm guessing you used solidworks? Apply the texture map there and it'll come in ready to go using UVs instead of model. Then you can move your model tree around to your heart's content. If you want to use keyshot's cylinder mapping, you need to use Model. So before you do Anything to the model, add it to a group. You don't have to use it, but you'll be happy you have it if you need it.
Also, if you are making 3 rows, add Another group. It should look like this:
     Parent Group for translate
         Child group for rows
              Actual Marker
That way, once you finish a row, you can simply duplicate the row of markers and move them into position.
You still have one marker. So now add the translation to the marker group.
Then add the rotation to the marker.
And here's where keyshot missed an opportunity. You can only pattern the parent group. So you'll have to duplicate the markers by hand. But don't worry, it gets exponentially faster.
Duplicate one, Move it a round number. You're in millimeters, so do something like 50, 75, 80, 100, really just be sure you don't use a decimal but staying on multiples of 5 will be the easiest to spot mistakes.
Now select 2 markers and duplicate them at the same time with the same offset. Now select 4. You see where I'm going with this.
Once you are done with a row, you can duplicate a whole row, which is nice because it allows you to change the offset of those later on without having to select each one.
After you're done there, you just need to change all the label materials.

There are probably a few other ways to handle it, but in general, the order you plan things out is important. Other software is more complicated, but has Much simpler solutions to problems like this. For instance, it's not all that complicated to get the markers to roll the correct amount based on their translation in other software. If you want to get that right in keyshot, you'll have to calculate the circumference, then divide the total translation of the marker in it's Local direction (this could be problematic in keyshot) and multiply by 360, to find out how much to rotate.

BTW, I know you're first year so you might not want to bite off too much, but render time for animations takes a while, but there is really no reason you can't render your markers in a real-time engine like Eevee. You're entire animation would render in minutes, rather than each frame taking minutes. I do see you are using Fuzz materials, so perhaps you have other camera shots planned. If you don't, then don't use fuzz. Also, don't use Fuzz just because you can. Creating a good texture map for the tip is Far more important to sell the markers as real than adding some fuzz. And turn off GI, it adds nothing to your scene, other than render time. The same goes for your spotlight. It's just a reflection object really, so just add that in your environment. It'll render much faster. Adding lights to the default environment is, again, about like polishing a turd. I suggest starting with a "real" environment hdri, turn it Waaaaay down, and add pins or physical lights from there. Physical lights can give nicer lighting, but if it's just a top down light, then it's virtually the same, and they render slower.
Also, is your sweep doing anything? If you aren't using the sweep, don't. (it also looks like it might have double faces on the round part, but it's hard to tell without exporting to something else)

Hopefully some of that helps you think about what you should do with what is available in your own time management for the project.




With animations like this, the order you plan to do things is really important.

Offline SeanHeaney

Re: Models won't rotate properly when animated
« Reply #5 on: March 19, 2021, 01:51:30 pm »
Hi Andy, thank you for taking the time to look at the model and help me out. After setting the pivot to the child of the model group name that I was trying to pivot around originally it worked perfectly! I have adjusted my scene with your recommendations and animated each pen rolling separately and the result looks great (although it did take ages). ;D