HayaiHa
09-09-2003, 04:51 PM
I was wondering if there was a way to convert an expression into a curve that could then be edited in the graph editor.
For example, if you create a spotlight there are options to add either an intensity or color curve to it. This then creates a lightinfo node and a curve which relates light intensity or color to the lightinfo's sampledistance. The curve can be edited in the graph editor so you can get the exact relationship between distance from the light and intensity at that point.
Another way to get a similar effect is to create the lightinfo node yourself, link it to the light and then write an expression that relates the sampledistance to the intensity. However, in this case all you have is the expression and no curve to edit.
Its possible to create an animation and then 'bake' the movements/rotations etc of an object against time into an editable curve (bake simulation). This then gives you greater control over tangents and positions of your animation curve to improve the final look of the motion.
(Almost there, just wanted to make it clear what I would like to do)
So, is it possible to create these curves for all sorts of things. Write an expression, say
float $distance = lightInfo1.sampleDistance;
pointLightShape1.intensity = sin($distance) ;
and then generate a graph of this expression which can be 'tweaked' in the graph editor to get exactly the relationship that you want?
Perhaps I have missed something glaringly obvious to do this, I'm sure Maya has the capabilities to have a graph of the relationship (as shown by the Intensity Curve for a spotlight button). Maybe its just not that simple to set up.
For example, if you create a spotlight there are options to add either an intensity or color curve to it. This then creates a lightinfo node and a curve which relates light intensity or color to the lightinfo's sampledistance. The curve can be edited in the graph editor so you can get the exact relationship between distance from the light and intensity at that point.
Another way to get a similar effect is to create the lightinfo node yourself, link it to the light and then write an expression that relates the sampledistance to the intensity. However, in this case all you have is the expression and no curve to edit.
Its possible to create an animation and then 'bake' the movements/rotations etc of an object against time into an editable curve (bake simulation). This then gives you greater control over tangents and positions of your animation curve to improve the final look of the motion.
(Almost there, just wanted to make it clear what I would like to do)
So, is it possible to create these curves for all sorts of things. Write an expression, say
float $distance = lightInfo1.sampleDistance;
pointLightShape1.intensity = sin($distance) ;
and then generate a graph of this expression which can be 'tweaked' in the graph editor to get exactly the relationship that you want?
Perhaps I have missed something glaringly obvious to do this, I'm sure Maya has the capabilities to have a graph of the relationship (as shown by the Intensity Curve for a spotlight button). Maybe its just not that simple to set up.
