chore: complete groups path effects work (#11373) 8f9dae9f36

* fix effects sorting

* fix Feature values

* invalidate effects on update instead than when dirt is added to avoid multiple invalidations per frame

* fix key conflict

Co-authored-by: hernan <hernan@rive.app>
This commit is contained in:
bodymovin
2026-01-03 00:49:09 +00:00
parent 075782ff46
commit 66c35233ff
6 changed files with 36 additions and 3 deletions

View File

@@ -1 +1 @@
df0db41a9cc7bd37e8421431f95952df21890faf
8f9dae9f361595302907e90ef18335b66c83d988

View File

@@ -5,6 +5,9 @@
"string": "scriptinputviewmodelproperty"
},
"extends": "custom_property.json",
"mixins": [
"script_input_common.json"
],
"properties": {
"dataTypeId": {
"type": "Id",
@@ -31,7 +34,7 @@
"type": "bool",
"initialValue": "false",
"key": {
"int": 922,
"int": 925,
"string": "isdatabindpathrelative"
},
"description": "Whether the data bind path is relative",

View File

@@ -35,6 +35,8 @@ public:
AdvanceFlags flags = AdvanceFlags::Animate |
AdvanceFlags::NewFrame) override;
bool addScriptedDirt(ComponentDirt value, bool recurse = false) override;
void buildDependencies() override;
void update(ComponentDirt value) override;
DataContext* dataContext() override
{
if (artboard() != nullptr)

View File

@@ -23,6 +23,7 @@ public:
void addPathProvider(PathProvider* component) override;
void addStrokeEffect(StrokeEffect* effect) override;
void invalidateEffect(PathProvider* effect) override;
void buildDependencies() override;
private:
std::vector<TargetEffect*> m_targetEffects;

View File

@@ -114,7 +114,6 @@ bool ScriptedPathEffect::advanceComponent(float elapsedSeconds,
bool ScriptedPathEffect::addScriptedDirt(ComponentDirt value, bool recurse)
{
invalidateEffectFromLocal();
return Component::addDirt(value, recurse);
}
@@ -162,4 +161,23 @@ EffectsContainer* ScriptedPathEffect::parentPaint()
EffectPath* ScriptedPathEffect::createEffectPath()
{
return new ScriptedEffectPath();
}
void ScriptedPathEffect::buildDependencies()
{
Super::buildDependencies();
if (parent())
{
parent()->addDependent(this);
}
}
void ScriptedPathEffect::update(ComponentDirt value)
{
Super::update(value);
if (hasDirt(value, ComponentDirt::ScriptUpdate))
{
invalidateEffectFromLocal();
}
}

View File

@@ -61,4 +61,13 @@ void GroupEffect::invalidateEffect(PathProvider* component)
{
effect->invalidateEffect(component);
}
}
void GroupEffect::buildDependencies()
{
Super::buildDependencies();
if (parent())
{
parent()->addDependent(this);
}
}