--User changes

-No longer constrain pitch, yaw or depth spinners to -180 - 180.

--Bug fixes
 -Properly set color index on padded xforms.
 -Adding a padding final xform included a linear variation with a weight of zero to not appear empty. Made it have a weight of 1.
 -Always write animate tag on final xform when saving to Xml.
 -Motion was being applied to the wrong flame in SheepTools::Edge(), so apply it to the correct one.
 -Prevent divide by zero when normalizing variation weights.
 -Was accidentally adding the placeholder value of -9999 for motion_offset to varation weights and parameters when applying motion. Set to zero if no value present.
 -Clamp flame rotation values to -180 - 180 when reading a flame from Xml.
 -Events were not properly wired for user changes in the random rotations per blend controls in the sequencer.
 -Fix major UI bugs with sequencer min/max random controls which made it nearly impossible to hand type values.
 -Values from rotations per blend and rotations per blend max were not being saved to file between program runs.
 -Checking animate for an xform was not applied to all flames even if Apply All was checked.
 -Changing interpolation type, temporal filter width, temporal type, and affine interpolation type were not actually saving to the flame when changed.
 -Grid on the main window was not being drawn at the right scale initially due to some OpenGL initialization occurring in the wrong order.
 -Severe bugs in sequence generation code:
  --Improperly detected padding xforms.
  --When looking for specific variations during xform aligning, only presence was detected, when it should have been presence plus a weight greater than zero.
  --When adding specific variations during xform aligning, must first remove any variations of that type.
  --Two variables were unsigned when they should have been signed. This prevented large blocks of code from ever executing.
  --When interpolating affines, an EPS that was too small was used, causing affine values to interpolate incorrectly. Instead use 1e-10 to ensure results equal to flam3.

--Code changes
 -Modify FractoriumEmberController::UpdateXform() to pass the selected xform index as well as the absolute index to func().
This commit is contained in:
Person
2018-06-12 21:20:15 -07:00
parent 05fabda748
commit 6ff199d1ef
30 changed files with 534 additions and 352 deletions

View File

@ -574,7 +574,7 @@ public:
for (auto var : variations) norm += var->m_Weight;
for (auto var : variations) var->m_Weight /= norm;
for (auto var : variations) var->m_Weight /= Zeps(norm);//Ensure a divide by zero never happens.
});
}
@ -708,10 +708,11 @@ public:
for (size_t i = 0; i < xform.m_Motion.size(); i++)
{
//Original only pulls these from the first motion xform which is a bug. Want to pull it from each one.
Xform<T>& currentMot = xform.m_Motion[i];
T freq = currentMot.m_MotionFreq;
eMotion func = currentMot.m_MotionFunc;
T offset = currentMot.m_MotionOffset;
auto& currentMot = xform.m_Motion[i];
auto freq = currentMot.m_MotionFreq;
auto func = currentMot.m_MotionFunc;
auto offset = currentMot.m_MotionOffset;
auto cleanOffset = offset != EMPTYFIELD ? offset : 0;
//Clamp these to the appropriate range after all are applied.
APPMOT(m_Weight);
APPMOT(m_ColorX);
@ -730,13 +731,13 @@ public:
if (!var)//It wasn't present, so add it and set the weight.
{
Variation<T>* newVar = motVar->Copy();
newVar->m_Weight = motVar->m_Weight * Interpolater<T>::MotionFuncs(func, freq * (blend + offset));
newVar->m_Weight = motVar->m_Weight * Interpolater<T>::MotionFuncs(func, freq * (blend + cleanOffset));
AddVariation(newVar);
var = newVar;//Use this below for params.
}
else//It was present, so apply the motion func to the weight.
{
var->m_Weight += motVar->m_Weight * Interpolater<T>::MotionFuncs(func, freq * (blend + offset));
var->m_Weight += motVar->m_Weight * Interpolater<T>::MotionFuncs(func, freq * (blend + cleanOffset));
}
//At this point, we've added if needed, or just applied the motion func to the weight.
@ -750,7 +751,7 @@ public:
for (size_t k = 0; k < motParVar->ParamCount(); k++)
{
if (!motParams[k].IsPrecalc())
*(params[k].Param()) += motParams[k].ParamVal() * Interpolater<T>::MotionFuncs(func, freq * (blend + offset));
*(params[k].Param()) += motParams[k].ParamVal() * Interpolater<T>::MotionFuncs(func, freq * (blend + cleanOffset));
}
}
}