Chelaru wrote:JeffR wrote:Chelaru wrote:Hey i think there is a small issue with the spot light and point light animation type. If i set for example brightness 0.2 and select one of the animation types the light goes from 1 brightness on the max value not the 0.2 value that i set up. Should it be like this or i am using it in a bad way?
Definitely sounds incorrect.
I'll check on that. Did it matter what animation type?
With all of them.
As a solution: a check box could be added to say if the user wants the animation to be from 1 brightness or the one that was set.
Well, I mean, if they wanted a brightness of 1 on the light, they'd probably just set the brightness to 1

Alright, could you make T3D/lightAnimData.cpp's animate function at line 193
bool LightAnimData::AnimValue<COUNT>::animate( F32 time, F32 *output )
{
F32 scaledTime, lerpFactor, valueRange, keyFrameLerp;
U32 posFrom, posTo;
S32 keyFrameFrom, keyFrameTo;
F32 initialValue = *output; //Add this
bool wasAnimated = false;
for ( U32 i=0; i < COUNT; i++ )
{
if ( mIsZero( timeScale[i] ) )
continue;
wasAnimated = true;
scaledTime = mFmod( time, period[i] ) * timeScale[i];
posFrom = mFloor( scaledTime );
posTo = mCeil( scaledTime );
keyFrameFrom = dToupper( keys[i][posFrom] ) - 65;
keyFrameTo = dToupper( keys[i][posTo] ) - 65;
valueRange = ( value2[i] - value1[i] ) / 25.0f;
if ( !smooth[i] )
output[i] = value1[i] + (keyFrameFrom * valueRange) * initialValue; //and add the * initialValue to the end
else
{
lerpFactor = scaledTime - posFrom;
keyFrameLerp = ( keyFrameTo - keyFrameFrom ) * lerpFactor;
output[i] = value1[i] + ( ( keyFrameFrom + keyFrameLerp ) * valueRange ) * initialValue; //and add the * initialValue to the end
}
}
return wasAnimated;
}
And see if that makes it behave as you expect.
The way it's set up, the min/max brightness is being set in the animation data, which makes it override the particular light. So we just scale it by our input brightness level, and it seemed to work for me. If that behaves as you expect, I'll get that rolled in.