Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

Maxscript: "Bake" values of multiple rotation controllers in list?
show user profile  kmackey
Say I have an object with several rotation controllers in a rotation list. I'm looking for a function that will take the resulting rotation of two or more of these controllers, and combine them into one (at the same time setting the values of the other controllers to zero). In other words, there would afterward be no difference in the actual rotation of the object, but the rotation values are now accessible in a single controller.

Other relevant factors:
1) The object is part of a chain, so parent object rotation may need to be taken into account.
2) The first controller in the list is an initial offset value, which should be left alone (in other words, simply taking the total resulting rotation of the object is not an option).
3) Some of the controllers being combined may have unequal weights, so their values would have to be combined accordingly.

I've tried this a number of different ways, but my background is in art and animation, not math. It's clear to me that I'm not going to find the correct solution for this on my own.
read 427 times
8/8/2014 10:28:28 PM (last edit: 8/8/2014 10:28:28 PM)
show user profile  K-tonne
have you tried scriptspot?

Website and Portfolio

read 419 times
8/9/2014 1:10:00 AM (last edit: 8/9/2014 1:10:00 AM)
show user profile  Dave
I'm fundamentally 'tarded when it comes to visualising issues that take more than 13 words to describe. It sounds like maybe you're doing a controller for a hand/fingers type of situation, and you want one controller to control them all?

"I flew over Egypt once"

read 414 times
8/9/2014 1:58:31 AM (last edit: 8/9/2014 1:58:31 AM)
show user profile  kmackey
K-tonne: I already tried looking on scriptspot, couldn't find anything. Doesn't mean it isn't there, just that I don't know how to do it.

Dave: No, it's not hands/fingers. It's actually more like having a rotation list with a manual controller and a lookAt controller. And I want to be able to take the rotation from the lookAt controller, and merge it with the manual controller.
read 407 times
8/9/2014 3:57:37 AM (last edit: 8/9/2014 3:57:37 AM)
show user profile  digital3ds
so, you're using terms here that may be confusing your question

you have 1 object with many "controllers" in a "list"... you want to "combine" the xyz values of many "controllers" into one, but set "others" to zero...

the object is part of a "chain", so the first object everything is linked to might need to be accounted for... ?

"the first controller in the list"...

some of the "controllers" being "combined" may have "unequal weights"

you are either way above my level of max knowledge, or phrasing your question poorly... I think an image here would benefit you the most

What I find confusing is your use of the terms "bake", "controller", "list", "combined", and "weights" - might also help to tell us what constraints you are using, etc - unless its just the lookAt constraint
- Mike Sawicki




read 402 times
8/9/2014 4:30:45 AM (last edit: 8/9/2014 5:10:17 AM)
show user profile  kmackey
Hi Mike, thanks for looking in.

The rotation controller looks like this:

It's possible that I am phrasing it poorly. I doubt that I'm above your level of max knowledge, but I am in a bit over my own head.

The pertinent details:
$obj.rotation.controller[1] needs to stay exactly as is before and after the function call.
$obj.rotation.controller[2] is a EulerXYZ rotation controller.
$obj.rotation.controller[3] is an orientation constraint, but has a weight value of 0. It's purpose is to be a variable in...
$obj.rotation.controller[4], a script that is based on an equation that includes [3]

After the function call, [2] will have now have the combined value of the previous values of [2] and [4]. The weight value of [2] will be set to 100 and the weight value of [4] will be set to 0.

To clarify some of the things that may have been confusing you:
-the object is part of a "chain": $obj is linked to another object, so if any calculations done using matrix3 values then, as I understand it, "inverse $obj.parent.transform" will have to be factored in.

-the first controller in the list: by this I just mean $obj.controller.rotation[1]

-some of the controllers being combined may have unequal weights: as a random example, $obj.rotation.controller.weight = #(100.0, 73.2, 0, 59.8). The weights of the controllers will modify the total rotation of $obj, and that total rotation should be the same before and after the function is called. So these will also need to be accounted for.

I say "bake" because what the function needs to do is similar to baking multiple layers of animation.

I think I covered what I meant by the other terms.
read 395 times
8/9/2014 5:47:02 AM (last edit: 8/9/2014 5:48:02 AM)
show user profile  digital3ds
terms understood... didn't know if you were just saying things

honestly it's still a bit vague... have you tried storing the combined values into a dummy object that you can reference later, that way your initial rotation remains as is, but you can call back to whenever you want?

it seems like w/e script you're using is causing some issue - maybe one of the maxscripters here can pick apart what your going after, but the order in which you're wanting to do things reads contradictory
- Mike Sawicki




read 381 times
8/9/2014 7:48:09 AM (last edit: 8/9/2014 10:24:51 AM)
show user profile  kmackey
Turns out I was overcomplicating things, as I sometimes do.


tm = obj.transform
obj.rotation.controller.weights[2].value = 100
obj.rotation.controller.weights[4].value = 0
obj.transform = tm
obj.rotation.controller.weights[4].value = 100


This was actually the first thing I tried, but it initially didn't work. On closer inspection, it turned out to be an issue with a variable in the script controller, and not anything wrong with this part of the solution. ><
read 372 times
8/9/2014 8:11:35 PM (last edit: 8/9/2014 8:11:35 PM)
#Maxforums IRC
Open chat window


Support Maxforums.org