Community
3ds Max Animation and Rigging
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max animation topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rotation Controller

23 REPLIES 23
SOLVED
Reply
Message 1 of 24
photodave
3181 Views, 23 Replies

Rotation Controller

OK hopefully I can explain this, I'm working on a very troublesome scene that if you can imagine a drill bit spinning at say 60 revolutions per minute and at random intervals have it stop for 10 or 15 frames and then continue spinning like its getting randomly stuck while drilling.

 

Here is my problem I'm running in to, when I try to stop the bit and restart, it spins backwards at times with using scripts and trackview. No matter what I do other than baking the animation on a per-key basis is the only route Ive found to work but is useless when I'm dealing with a few thousand frames and I get a change request on the rotation.

 

Is there anyone that has or knows of a script that will spin objects in a single direction and that can be started and stopped intermittently? I'm more than happy to pay if it works...

 

Cheers,

 

-dave

23 REPLIES 23
Message 2 of 24
leeminardi
in reply to: photodave

Do you think the appearance of the drill spinning backwards is the result of it spinning forward by an amount that makes it look like it is spinning backwards (like the wagon wheels in the old westerns) or the result of using a of a "loop" in the transition methods between key frame (e.g., using Bezier instead of Linear)?  

 

Another thing to consider is that quaternions as used in TCB controllers as opposed to transformation matrices as used with Euclidean rotations is the elimination of gimbal lock that can yield unpredictable rotation direction. 

 

Can you post the script that you are using? 

 

~Lee

lee.minardi
Message 3 of 24

Hi @photodave,

 

Just wanted to follow-up to see if you were able to resolve this issue. =]

 

I'm not sure I could help too much with the scripting bit, but I could definitely take a look at the file if you have some animated keys in there and see what could be done. Please just let me know as I'm happy to help!

 

Thank you =P

Please Accept as Solution if a reply has helped resolved the issue or answered your question, to help others in the community.

Kindest regards,


Dominique Bouthillette
Principal Specialist, Industry Support & Escalation
Entertainment & Media Solutions
Message 4 of 24

Thank you both for replying,

 

I still have not found a viable solution to this problem,

 

Ive made a simple 3dsmax 2016 scene to demonstrate what I am trying to achieve. In the attached file the green object is just manually key framed to show the effect I'm going for. the red one to the right of it is the closest solution I have found yet using a multiplier curve but its still flaky and unpredictable in its results. As far as scripts go since none have worked as hoped or required I have since deleted any that I had tried.

 

Thank you,

 

-dave

Message 5 of 24
ads_royje
in reply to: photodave

Hi @photodave,

 

the way you animated with the fcurve is the "best" out of the box way to do! 🙂

But I understand very well the issue you are facing when trying to edit the rotation to stop and resume!

This is not a trivial problem to solve using scripting. 😕 The tool would need to keep track of rotation over time and have to ability to stop / resume from given frames and be editable without affecting the rotation speed. If I understand the issue well.

 

Have you heard of MCG (Max Creation Graph) ?

This is brand new node based scripting for Max, to get either Geometry objects, modifiers or (what is usable here) controllers.

Using MCG you can build your own controllers to have the behavior that you need, as specific to your needs! 🙂

 

I've attached a zip file, with an MCG rotation controller and a video that shows what it does. I tried to make it as close to what I understood of the issue you are describing.

 

The Rotation controller has 4 inputs : (Sorry I did not tweak the UI at all ... so it's very basic)

RotationController.jpg

Axis to Rotation : Value 1 2 3 for axis X Y Z

Additive Rotation : This is though of as a "start offset" if needed be.

Rot Per Sec : This is a 'Velocity' value. The Rotation speed per second (animatable to have acceleration / deceleration)

[x] Rotate_OnOff : This is the 'feature' you may want to look at! If I got the issue right! While On the object rotates. While Off the Object does not rotate. Animatable.

 

While the Rotate_OnOff is Off there is no rotation, from the On Key it will resume (not going backward). The tool will handle the rotations for you. And will resume from previous keys. These OnOff keys can be moved, added, removed from anywhere in time line. The tool will handle the rotation so they always resume from last keys.

I've attached the tool and a video 'tutorial' of its usage.

The tool file name is "Rotation_Velocity_Togglable.maxtool".

To use in Max, copy the .maxtool file in your local MCG folder located : C:\Users\ <username> \Autodesk\3ds Max 2016\Max Creation Graph\Tools

 

Start Max.

The MCG controller for Rotation is now available from the Rotation Controllers as "Rotation_Velocity_Togglable".

Current known issue not fixed, the Rotate_OnOff will have a float as default, change it to Boolean to have a true On/Off.

 

I hope this can help your animation editing. 🙂

Let me know if you try or not and if it does meet your requirements.

 

Cheers! 🙂

Message 6 of 24
photodave
in reply to: ads_royje

Hi @ads_royje,

 

Thank you so very much for taking the time to do this, I am downloading it now and will try it in my production scene shortly and let you know how it works.

 

I do know of the MCG but to me at the moment anything scripting might as well be written in Egyptian hieroglyphs lol but I do plan on looking more in to it when I have a little down time as even though Im an old dog I do love to learn new things and see this as a positive new challenge.

 

Thanks again and Ill let you know how it works out.

 

Cheers,

 

-dave

Message 7 of 24
photodave
in reply to: photodave

Hi again @ads_royje

 

Looks like Im missing a patch maybe or service pack, it doesn't show up in the tools where you show in the video and when I open it in MCG I get a couple errors in the attached image.I am using 3dsmax 2016 SP3

 

MCG problem.jpg

 

-dave

Message 8 of 24
ads_royje
in reply to: photodave

Hi again @photodave,

 

hoo crap my bad!!! 😞 I should of used our packaging system!

 

I would of though I used our default compounds, which are the errors (thanks for the Graph Screenshot! )

 

Attached the same graph as .mcg

 

Glad to read that you know of MCG ! 🙂 Still quite new and not a lot of people are aware of its existence!

 

You may know already how to install a .mcg. (just remove the .zip at the end as the AREA did not accept .mcg file)

Just in case. From Max MCG Editor > File > Install Max Creation Graph.

 

I should of done so in the first place ... again sorry for that!

 

Let me know if that goes better or not!

Thanks for your rapid feedback!! 🙂

Message 9 of 24
photodave
in reply to: ads_royje

Sorry for all the trouble but when trying to install it Im still getting the following error:

 

"Validation failed for \Users\XXXXXX\Autodesk\3ds Max 2016\Max Creation Graph\Tools\Downloads\Rotation_Velocity_Togglable.maxtool : Error occurred deserializing node: Can't find operator Output: Rotation Controller"

 

Message 10 of 24
ads_royje
in reply to: photodave

(doh)

again, my bad!

As your last reply I just recalled that in 2016, the "Output : Controllers" were shipped with Extension pack, available to subscribers only ... (doh)...

 

hum.... I'll have to see if I can figure a way around this ... if any.

I am sorry for the trouble!

I'll try to get something working for you! asap!

 

Message 11 of 24
photodave
in reply to: ads_royje

Oh ok, Ill see if I can still grab the expansion pack then. I have a subscription 🙂

 

*edit*

 

EXT1 did it 🙂 now going to try it out. TYVM again.

 

Message 12 of 24
ads_royje
in reply to: photodave

Awesome! Let me know!
Otherwise, i can convert the output to a modifier and rotate the mesh instead! If that would work for you not having the rotation on a controller but directly on the mesh!
Message 13 of 24
photodave
in reply to: ads_royje

@ads_royje

 

You Sir are AWESOME!! it looks like it is doing exactly what I need. Ive only tried it on a basic scene so far but it looks to be working very well!! you have no idea how happy I am right now, this has been a holy grail for me with max for more than half the years I have been working with 3dsmax. (trying not to show my age lol its been a while)

 

thank you so very much again!

 

-dave

Message 14 of 24
ads_royje
in reply to: photodave

🙂 !!!! I am so happy to read that it works and that I understood what you wanted!!! 🙂

If you encounter any issue, let me know and i'll fix !!!

I hope the graph itself has enought comments and organization to get you into the groove of using MCG !!!

Let me know if you get your final animation animated fast!!! 🙂
Message 15 of 24
photodave
in reply to: ads_royje


@ads_royje wrote:
🙂 !!!! I am so happy to read that it works and that I understood what you wanted!!! 🙂

If you encounter any issue, let me know and i'll fix !!!

I hope the graph itself has enought comments and organization to get you into the groove of using MCG !!!

Let me know if you get your final animation animated fast!!! 🙂

I will let you know, thanks again 🙂

Message 16 of 24
leeminardi
in reply to: ads_royje

After trying a bunch of things I gave up trying to make a max controller that controlled a rotating object as requested.

 

I did create an Excel VBA program that create a Max script.

 

Make sure you have an object with the name you specify in Excel.  The resulting .ms file will be located in the same folder as the Excel file.  You can specify a range for the random number of frames the object will spin and  stay stationary.   The speed up and slow down is a fixed number of frames that you can specify as well. 

 

Here's an example of the first few lines of a sample script.  I took a brute force approach and generated keys for every frame.

 

select $bit3
sliderTime = 8f
addNewKey $.rotation.controller.Z_Rotation.controller 8f #select
$.rotation.controller.Z_Rotation.controller.keys[1].value = -9.549
addNewKey $.rotation.controller.Z_Rotation.controller 9f #select
$.rotation.controller.Z_Rotation.controller.keys[2].value = -19.098
addNewKey $.rotation.controller.Z_Rotation.controller 10f #select
$.rotation.controller.Z_Rotation.controller.keys[3].value = -28.647
addNewKey $.rotation.controller.Z_Rotation.controller 11f #select
$.rotation.controller.Z_Rotation.controller.keys[4].value = -38.196

 

Lee

lee.minardi
Message 17 of 24
photodave
in reply to: leeminardi

Hi @leeminardi,

 

Thank you for taking the time and effort to come up with a solution but unfortunately you lost me at Excel as I know little to nothing about M$ Office and avoid it as much as I can lol. I think the MCG provided above is starting to work very well and I think after I figure out how to tweek it a bit it should do everything I need.

 

Thanks again,

 

-dave

 

 

Message 18 of 24
leeminardi
in reply to: photodave

You don't need to know much about Excel to use the rotating bit script I wrote.  Just open the file in Excel from my previous post  (if you have Excel) and set the values for the various parameters (yellow boxes) then click the Write Script button.  The program creates a Max script in the same folder as the Excel file.

 

O4.JPG

 

I've attached a file of the script generated for the parameters shown above so you can see what it does.  You can test it out by running it in a Max file that has an object named bit3.

 

I am not familiar with MCG.  It looks over my head!  I am glad to know you can get it to do what you want.  It was an interesting problem to solve.

 

Best regards,

 

Lee

 

 

lee.minardi
Message 19 of 24
photodave
in reply to: leeminardi

Thanks again @leeminardi

 

Ill still have a look at your solution as in my opinion you can never have too many tools in your toolbox 🙂

 

-dave

Message 20 of 24
photodave
in reply to: ads_royje

@ads_royje

 

Just one more question, I need to install the MCG on my render farm, is there a different place I can drop the files so they will get picked up by 3dsmax on the slaves like under program files or something rather than under a user profile?

 

Thanks again,

 

-dave

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report