Skip to content

Commit

Permalink
Renamed attenuation to POV-Ray Fade for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
leozide committed Apr 7, 2024
1 parent b6de368 commit 66f4e42
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 78 deletions.
16 changes: 8 additions & 8 deletions common/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ QVariant lcCamera::GetPropertyValue(lcObjectPropertyId PropertyId) const
case lcObjectPropertyId::LightColor:
case lcObjectPropertyId::LightPower:
case lcObjectPropertyId::LightCastShadow:
case lcObjectPropertyId::LightAttenuationDistance:
case lcObjectPropertyId::LightAttenuationPower:
case lcObjectPropertyId::LightPOVRayFadeDistance:
case lcObjectPropertyId::LightPOVRayFadePower:
case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
case lcObjectPropertyId::LightDirectionalSize:
Expand Down Expand Up @@ -707,8 +707,8 @@ bool lcCamera::SetPropertyValue(lcObjectPropertyId PropertyId, lcStep Step, bool
case lcObjectPropertyId::LightColor:
case lcObjectPropertyId::LightPower:
case lcObjectPropertyId::LightCastShadow:
case lcObjectPropertyId::LightAttenuationDistance:
case lcObjectPropertyId::LightAttenuationPower:
case lcObjectPropertyId::LightPOVRayFadeDistance:
case lcObjectPropertyId::LightPOVRayFadePower:
case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
case lcObjectPropertyId::LightDirectionalSize:
Expand Down Expand Up @@ -769,8 +769,8 @@ bool lcCamera::HasKeyFrame(lcObjectPropertyId PropertyId, lcStep Time) const
case lcObjectPropertyId::LightColor:
case lcObjectPropertyId::LightPower:
case lcObjectPropertyId::LightCastShadow:
case lcObjectPropertyId::LightAttenuationDistance:
case lcObjectPropertyId::LightAttenuationPower:
case lcObjectPropertyId::LightPOVRayFadeDistance:
case lcObjectPropertyId::LightPOVRayFadePower:
case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
case lcObjectPropertyId::LightDirectionalSize:
Expand Down Expand Up @@ -831,8 +831,8 @@ bool lcCamera::SetKeyFrame(lcObjectPropertyId PropertyId, lcStep Time, bool KeyF
case lcObjectPropertyId::LightColor:
case lcObjectPropertyId::LightPower:
case lcObjectPropertyId::LightCastShadow:
case lcObjectPropertyId::LightAttenuationDistance:
case lcObjectPropertyId::LightAttenuationPower:
case lcObjectPropertyId::LightPOVRayFadeDistance:
case lcObjectPropertyId::LightPOVRayFadePower:
case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
case lcObjectPropertyId::LightDirectionalSize:
Expand Down
12 changes: 6 additions & 6 deletions common/lc_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3130,22 +3130,22 @@ void lcModel::SetCameraZFar(lcCamera* Camera, float ZFar)
UpdateAllViews();
}

void lcModel::SetLightAttenuationDistance(lcLight* Light, float Distance)
void lcModel::SetLightPOVRayFadeDistance(lcLight* Light, float Distance)
{
Light->SetAttenuationDistance(Distance, mCurrentStep, gMainWindow->GetAddKeys());
Light->SetPOVRayFadeDistance(Distance, mCurrentStep, gMainWindow->GetAddKeys());
Light->UpdatePosition(mCurrentStep);

SaveCheckpoint(tr("Changing Light Attenuation Distance"));
SaveCheckpoint(tr("Changing Light POV-Ray Fade Distance"));
gMainWindow->UpdateSelectedObjects(false);
UpdateAllViews();
}

void lcModel::SetLightAttenuationPower(lcLight* Light, float Power)
void lcModel::SetLightPOVRayFadePower(lcLight* Light, float Power)
{
Light->SetAttenuationPower(Power, mCurrentStep, gMainWindow->GetAddKeys());
Light->SetPOVRayFadePower(Power, mCurrentStep, gMainWindow->GetAddKeys());
Light->UpdatePosition(mCurrentStep);

SaveCheckpoint(tr("Changing Light Attenuation Power"));
SaveCheckpoint(tr("Changing Light POV-Ray Fade Power"));
gMainWindow->UpdateSelectedObjects(false);
UpdateAllViews();
}
Expand Down
4 changes: 2 additions & 2 deletions common/lc_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ class lcModel
void SetCameraZNear(lcCamera* Camera, float ZNear);
void SetCameraZFar(lcCamera* Camera, float ZFar);

void SetLightAttenuationDistance(lcLight* Light, float Distance);
void SetLightAttenuationPower(lcLight* Light, float Power);
void SetLightPOVRayFadeDistance(lcLight* Light, float Distance);
void SetLightPOVRayFadePower(lcLight* Light, float Power);
void SetSpotLightConeAngle(lcLight* Light, float Angle);
void SetSpotLightPenumbraAngle(lcLight* Light, float Angle);
void SetSpotLightTightness(lcLight* Light, float Tightness);
Expand Down
4 changes: 2 additions & 2 deletions common/lc_objectproperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ enum class lcObjectPropertyId
LightColor,
LightPower,
LightCastShadow,
LightAttenuationDistance,
LightAttenuationPower,
LightPOVRayFadeDistance,
LightPOVRayFadePower,
LightPointSize,
LightSpotSize,
LightDirectionalSize,
Expand Down
24 changes: 12 additions & 12 deletions common/lc_propertieswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,13 @@ void lcPropertiesWidget::FloatChanged()
{
Model->SetLightPower(Light, Value);
}
else if (PropertyId == lcObjectPropertyId::LightAttenuationDistance)
else if (PropertyId == lcObjectPropertyId::LightPOVRayFadeDistance)
{
Model->SetLightAttenuationDistance(Light, Value);
Model->SetLightPOVRayFadeDistance(Light, Value);
}
else if (PropertyId == lcObjectPropertyId::LightAttenuationPower)
else if (PropertyId == lcObjectPropertyId::LightPOVRayFadePower)
{
Model->SetLightAttenuationPower(Light, Value);
Model->SetLightPOVRayFadePower(Light, Value);
}
else if (PropertyId == lcObjectPropertyId::LightPointSize || PropertyId == lcObjectPropertyId::LightSpotSize || PropertyId == lcObjectPropertyId::LightDirectionalSize || PropertyId == lcObjectPropertyId::LightAreaSizeX)
{
Expand Down Expand Up @@ -1032,8 +1032,8 @@ void lcPropertiesWidget::CreateWidgets()

AddColorProperty(lcObjectPropertyId::LightColor, tr("Color"), tr("Light color"), true);
AddFloatProperty(lcObjectPropertyId::LightPower, tr("Power"), tr("Power of the light (Watts in Blender, multiplicative factor in POV-Ray)"), true, 0.0f, FLT_MAX);
AddFloatProperty(lcObjectPropertyId::LightAttenuationDistance, tr("Fade Distance"), tr("The distance at which the full light intensity arrives (POV-Ray only)"), true, 0.0f, FLT_MAX);
AddFloatProperty(lcObjectPropertyId::LightAttenuationPower, tr("Fade Power"), tr("Light falloff rate (POV-Ray only)"), true, 0.0f, FLT_MAX);
AddFloatProperty(lcObjectPropertyId::LightPOVRayFadeDistance, tr("Fade Distance"), tr("The distance at which the full light intensity arrives (POV-Ray only)"), true, 0.0f, FLT_MAX);
AddFloatProperty(lcObjectPropertyId::LightPOVRayFadePower, tr("Fade Power"), tr("Light falloff rate (POV-Ray only)"), true, 0.0f, FLT_MAX);
AddBoolProperty(lcObjectPropertyId::LightCastShadow, tr("Cast Shadow"), tr("Cast a shadow from this light"), false);

AddSpacing();
Expand Down Expand Up @@ -1259,8 +1259,8 @@ void lcPropertiesWidget::SetLight(const lcArray<lcObject*>& Selection, lcObject*
lcLightAreaShape LightAreaShape = lcLightAreaShape::Count;
lcVector2 LightSize(0.0f, 0.0f);
float Power = 0.0f;
float AttenuationDistance = 0.0f;
float AttenuationPower = 0.0f;
float FadeDistance = 0.0f;
float FadePower = 0.0f;
lcVector3 Position(0.0f, 0.0f, 0.0f);
lcVector3 Rotation = lcVector3(0.0f, 0.0f, 0.0f);
float SpotConeAngle = 0.0f, SpotPenumbraAngle = 0.0f, SpotTightness = 0.0f;
Expand All @@ -1273,8 +1273,8 @@ void lcPropertiesWidget::SetLight(const lcArray<lcObject*>& Selection, lcObject*
Position = Light->GetPosition();
Rotation = lcMatrix44ToEulerAngles(Light->GetWorldMatrix()) * LC_RTOD;
Power = Light->GetPower();
AttenuationDistance = Light->GetAttenuationDistance();
AttenuationPower = Light->GetAttenuationPower();
FadeDistance = Light->GetPOVRayFadeDistance();
FadePower = Light->GetPOVRayFadePower();
SpotConeAngle = Light->GetSpotConeAngle();
SpotPenumbraAngle = Light->GetSpotPenumbraAngle();
SpotTightness = Light->GetSpotTightness();
Expand Down Expand Up @@ -1322,8 +1322,8 @@ void lcPropertiesWidget::SetLight(const lcArray<lcObject*>& Selection, lcObject*
UpdateFloat(lcObjectPropertyId::LightPower, Power);
UpdateBool(lcObjectPropertyId::LightCastShadow);

UpdateFloat(lcObjectPropertyId::LightAttenuationDistance, AttenuationDistance);
UpdateFloat(lcObjectPropertyId::LightAttenuationPower, AttenuationPower);
UpdateFloat(lcObjectPropertyId::LightPOVRayFadeDistance, FadeDistance);
UpdateFloat(lcObjectPropertyId::LightPOVRayFadePower, FadePower);

const bool IsPointLight = (LightType == lcLightType::Point);
SetPropertyVisible(lcObjectPropertyId::LightPointSize, IsPointLight);
Expand Down
56 changes: 28 additions & 28 deletions common/light.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ void lcLight::SaveLDraw(QTextStream& Stream) const
mColor.Save(Stream, "LIGHT", "COLOR", true);
mSize.Save(Stream, "LIGHT", "SIZE", true);
mPower.Save(Stream, "LIGHT", "POWER", true);
mAttenuationDistance.Save(Stream, "LIGHT", "ATTENUATION_DISTANCE", true);
mAttenuationPower.Save(Stream, "LIGHT", "ATTENUATION_POWER", true);
mPOVRayFadeDistance.Save(Stream, "LIGHT", "POVRAY_FADE_DISTANCE", true);
mPOVRayFadePower.Save(Stream, "LIGHT", "POVRAY_FADE_POWER", true);

switch (mLightType)
{
Expand Down Expand Up @@ -240,9 +240,9 @@ bool lcLight::ParseLDrawLine(QTextStream& Stream)
continue;
else if (mPower.Load(Stream, Token, "POWER"))
continue;
else if (mAttenuationDistance.Load(Stream, Token, "ATTENUATION_DISTANCE"))
else if (mPOVRayFadeDistance.Load(Stream, Token, "POVRAY_FADE_DISTANCE"))
continue;
else if (mAttenuationPower.Load(Stream, Token, "ATTENUATION_POWER"))
else if (mPOVRayFadePower.Load(Stream, Token, "POVRAY_FADE_POWER"))
continue;
else if (mSpotConeAngle.Load(Stream, Token, "SPOT_CONE_ANGLE"))
continue;
Expand Down Expand Up @@ -514,14 +514,14 @@ bool lcLight::SetColor(const lcVector3& Color, lcStep Step, bool AddKey)
return mColor.ChangeKey(Color, Step, AddKey);
}

void lcLight::SetAttenuationDistance(float Distance, lcStep Step, bool AddKey)
void lcLight::SetPOVRayFadeDistance(float Distance, lcStep Step, bool AddKey)
{
mAttenuationDistance.ChangeKey(Distance, Step, AddKey);
mPOVRayFadeDistance.ChangeKey(Distance, Step, AddKey);
}

void lcLight::SetAttenuationPower(float Power, lcStep Step, bool AddKey)
void lcLight::SetPOVRayFadePower(float Power, lcStep Step, bool AddKey)
{
mAttenuationPower.ChangeKey(Power, Step, AddKey);
mPOVRayFadePower.ChangeKey(Power, Step, AddKey);
}

void lcLight::SetSpotConeAngle(float Angle, lcStep Step, bool AddKey)
Expand Down Expand Up @@ -595,8 +595,8 @@ void lcLight::InsertTime(lcStep Start, lcStep Time)
mAreaGrid.InsertTime(Start, Time);
mSize.InsertTime(Start, Time);
mPower.InsertTime(Start, Time);
mAttenuationDistance.InsertTime(Start, Time);
mAttenuationPower.InsertTime(Start, Time);
mPOVRayFadeDistance.InsertTime(Start, Time);
mPOVRayFadePower.InsertTime(Start, Time);
}

void lcLight::RemoveTime(lcStep Start, lcStep Time)
Expand All @@ -610,8 +610,8 @@ void lcLight::RemoveTime(lcStep Start, lcStep Time)
mAreaGrid.RemoveTime(Start, Time);
mSize.RemoveTime(Start, Time);
mPower.RemoveTime(Start, Time);
mAttenuationDistance.RemoveTime(Start, Time);
mAttenuationPower.RemoveTime(Start, Time);
mPOVRayFadeDistance.RemoveTime(Start, Time);
mPOVRayFadePower.RemoveTime(Start, Time);
}

void lcLight::UpdatePosition(lcStep Step)
Expand All @@ -625,8 +625,8 @@ void lcLight::UpdatePosition(lcStep Step)
mAreaGrid.Update(Step);
mSize.Update(Step);
mPower.Update(Step);
mAttenuationDistance.Update(Step);
mAttenuationPower.Update(Step);
mPOVRayFadeDistance.Update(Step);
mPOVRayFadePower.Update(Step);

if (IsPointLight())
{
Expand Down Expand Up @@ -1087,8 +1087,8 @@ QVariant lcLight::GetPropertyValue(lcObjectPropertyId PropertyId) const
case lcObjectPropertyId::LightCastShadow:
return GetCastShadow();

case lcObjectPropertyId::LightAttenuationDistance:
case lcObjectPropertyId::LightAttenuationPower:
case lcObjectPropertyId::LightPOVRayFadeDistance:
case lcObjectPropertyId::LightPOVRayFadePower:
case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
case lcObjectPropertyId::LightDirectionalSize:
Expand Down Expand Up @@ -1161,8 +1161,8 @@ bool lcLight::SetPropertyValue(lcObjectPropertyId PropertyId, lcStep Step, bool
case lcObjectPropertyId::LightCastShadow:
return SetCastShadow(Value.toBool());

case lcObjectPropertyId::LightAttenuationDistance:
case lcObjectPropertyId::LightAttenuationPower:
case lcObjectPropertyId::LightPOVRayFadeDistance:
case lcObjectPropertyId::LightPOVRayFadePower:
case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
case lcObjectPropertyId::LightDirectionalSize:
Expand Down Expand Up @@ -1231,11 +1231,11 @@ bool lcLight::HasKeyFrame(lcObjectPropertyId PropertyId, lcStep Time) const
case lcObjectPropertyId::LightCastShadow:
return false;

case lcObjectPropertyId::LightAttenuationDistance:
return mAttenuationDistance.HasKeyFrame(Time);
case lcObjectPropertyId::LightPOVRayFadeDistance:
return mPOVRayFadeDistance.HasKeyFrame(Time);

case lcObjectPropertyId::LightAttenuationPower:
return mAttenuationPower.HasKeyFrame(Time);
case lcObjectPropertyId::LightPOVRayFadePower:
return mPOVRayFadePower.HasKeyFrame(Time);

case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
Expand Down Expand Up @@ -1313,11 +1313,11 @@ bool lcLight::SetKeyFrame(lcObjectPropertyId PropertyId, lcStep Time, bool KeyFr
case lcObjectPropertyId::LightCastShadow:
return false;

case lcObjectPropertyId::LightAttenuationDistance:
return mAttenuationDistance.SetKeyFrame(Time, KeyFrame);
case lcObjectPropertyId::LightPOVRayFadeDistance:
return mPOVRayFadeDistance.SetKeyFrame(Time, KeyFrame);

case lcObjectPropertyId::LightAttenuationPower:
return mAttenuationPower.SetKeyFrame(Time, KeyFrame);
case lcObjectPropertyId::LightPOVRayFadePower:
return mPOVRayFadePower.SetKeyFrame(Time, KeyFrame);

case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
Expand Down Expand Up @@ -1371,6 +1371,6 @@ void lcLight::RemoveKeyFrames()
mAreaGrid.RemoveAllKeys();
mSize.RemoveAllKeys();
mPower.RemoveAllKeys();
mAttenuationDistance.RemoveAllKeys();
mAttenuationPower.RemoveAllKeys();
mPOVRayFadeDistance.RemoveAllKeys();
mPOVRayFadePower.RemoveAllKeys();
}
16 changes: 8 additions & 8 deletions common/light.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,18 @@ class lcLight : public lcObject
return mColor;
}

void SetAttenuationDistance(float Distance, lcStep Step, bool AddKey);
void SetPOVRayFadeDistance(float Distance, lcStep Step, bool AddKey);

float GetAttenuationDistance() const
float GetPOVRayFadeDistance() const
{
return mAttenuationDistance;
return mPOVRayFadeDistance;
}

void SetAttenuationPower(float Power, lcStep Step, bool AddKey);
void SetPOVRayFadePower(float Power, lcStep Step, bool AddKey);

float GetAttenuationPower() const
float GetPOVRayFadePower() const
{
return mAttenuationPower;
return mPOVRayFadePower;
}

void SetSpotConeAngle(float Angle, lcStep Step, bool AddKey);
Expand Down Expand Up @@ -339,8 +339,8 @@ class lcLight : public lcObject
lcObjectProperty<lcVector3> mColor = lcObjectProperty<lcVector3>(lcVector3(1.0f, 1.0f, 1.0f));
lcObjectProperty<lcVector2> mSize = lcObjectProperty<lcVector2>(lcVector2(0.0f, 0.0f));
lcObjectProperty<float> mPower = lcObjectProperty<float>(1.0f);
lcObjectProperty<float> mAttenuationDistance = lcObjectProperty<float>(0.0f);
lcObjectProperty<float> mAttenuationPower = lcObjectProperty<float>(0.0f);
lcObjectProperty<float> mPOVRayFadeDistance = lcObjectProperty<float>(0.0f);
lcObjectProperty<float> mPOVRayFadePower = lcObjectProperty<float>(0.0f);
lcObjectProperty<float> mSpotConeAngle = lcObjectProperty<float>(80.0f);
lcObjectProperty<float> mSpotPenumbraAngle = lcObjectProperty<float>(0.0f);
lcObjectProperty<float> mSpotTightness = lcObjectProperty<float>(0.0f);
Expand Down
4 changes: 2 additions & 2 deletions common/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ QString lcObject::GetCheckpointString(lcObjectPropertyId PropertyId)
case lcObjectPropertyId::LightCastShadow:
return QT_TRANSLATE_NOOP("Checkpoint", "Changing Light Shadow");

case lcObjectPropertyId::LightAttenuationDistance:
case lcObjectPropertyId::LightAttenuationPower:
case lcObjectPropertyId::LightPOVRayFadeDistance:
case lcObjectPropertyId::LightPOVRayFadePower:
case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
case lcObjectPropertyId::LightDirectionalSize:
Expand Down
16 changes: 8 additions & 8 deletions common/piece.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,8 @@ QVariant lcPiece::GetPropertyValue(lcObjectPropertyId PropertyId) const
case lcObjectPropertyId::LightColor:
case lcObjectPropertyId::LightPower:
case lcObjectPropertyId::LightCastShadow:
case lcObjectPropertyId::LightAttenuationDistance:
case lcObjectPropertyId::LightAttenuationPower:
case lcObjectPropertyId::LightPOVRayFadeDistance:
case lcObjectPropertyId::LightPOVRayFadePower:
case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
case lcObjectPropertyId::LightDirectionalSize:
Expand Down Expand Up @@ -750,8 +750,8 @@ bool lcPiece::SetPropertyValue(lcObjectPropertyId PropertyId, lcStep Step, bool
case lcObjectPropertyId::LightColor:
case lcObjectPropertyId::LightPower:
case lcObjectPropertyId::LightCastShadow:
case lcObjectPropertyId::LightAttenuationDistance:
case lcObjectPropertyId::LightAttenuationPower:
case lcObjectPropertyId::LightPOVRayFadeDistance:
case lcObjectPropertyId::LightPOVRayFadePower:
case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
case lcObjectPropertyId::LightDirectionalSize:
Expand Down Expand Up @@ -804,8 +804,8 @@ bool lcPiece::HasKeyFrame(lcObjectPropertyId PropertyId, lcStep Time) const
case lcObjectPropertyId::LightColor:
case lcObjectPropertyId::LightPower:
case lcObjectPropertyId::LightCastShadow:
case lcObjectPropertyId::LightAttenuationDistance:
case lcObjectPropertyId::LightAttenuationPower:
case lcObjectPropertyId::LightPOVRayFadeDistance:
case lcObjectPropertyId::LightPOVRayFadePower:
case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
case lcObjectPropertyId::LightDirectionalSize:
Expand Down Expand Up @@ -864,8 +864,8 @@ bool lcPiece::SetKeyFrame(lcObjectPropertyId PropertyId, lcStep Time, bool KeyFr
case lcObjectPropertyId::LightColor:
case lcObjectPropertyId::LightPower:
case lcObjectPropertyId::LightCastShadow:
case lcObjectPropertyId::LightAttenuationDistance:
case lcObjectPropertyId::LightAttenuationPower:
case lcObjectPropertyId::LightPOVRayFadeDistance:
case lcObjectPropertyId::LightPOVRayFadePower:
case lcObjectPropertyId::LightPointSize:
case lcObjectPropertyId::LightSpotSize:
case lcObjectPropertyId::LightDirectionalSize:
Expand Down
4 changes: 2 additions & 2 deletions common/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2189,8 +2189,8 @@ bool Project::ExportPOVRay(const QString& FileName)
LightType = Light->GetLightType();
Shadowless = Light->GetCastShadow() ? 0 : 1;
Power = Light->GetPower();
FadeDistance = Light->GetAttenuationDistance();
FadePower = Light->GetAttenuationPower();
FadeDistance = Light->GetPOVRayFadeDistance();
FadePower = Light->GetPOVRayFadePower();

switch (LightType)
{
Expand Down

0 comments on commit 66f4e42

Please sign in to comment.