Skip to content

Commit

Permalink
add findParameterIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed Mar 27, 2022
1 parent d4a472f commit 31dabf1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion source/inochi2d/core/puppet.d
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public:
root.beginUpdate();

if (renderParameters) {

// Update parameters
foreach(parameter; parameters) {
parameter.update();
Expand All @@ -368,6 +368,18 @@ public:
root.update();
}

/**
Returns the index of a parameter
*/
ptrdiff_t findParameterIndex(string name) {
foreach(i, parameter; parameters) {
if (parameter.name == name) {
return i;
}
}
return -1;
}

/**
Draws the puppet
*/
Expand Down

0 comments on commit 31dabf1

Please sign in to comment.