rex_ginstgroup
Introduction
This plugin could group instances by stored UID of these instances, each instances group could be treated as a set to have set operations, or a list/array to have push/pop/sorting/shuffling operations.
It could be used with a function object, to pass or return multiple picked instances.
This plugin could group instances by stored UID of these instances, each instances group could be treated as a set to have set operations, or a list/array to have push/pop/sorting/shuffling operations.
It could be used with a function object, to pass or return multiple picked instances.
Usage
Sample capx
Sample capx
Add instance(s)
These actions could add instance(s) into group,
These actions could add instance(s) into group,
- Action:Add instances
- Action:Add instances by UID
- Action:Clean & Add instances
- Action:Clean & Add instance by UID
Remove instance(s)
These actions could remove instance(s)
These actions could remove instance(s)
- Action:Remove instances
- Action:Remove instances by UID
Clean or destroy group
This actions could clean or destroy group
This actions could clean or destroy group
- Action:Clean group
- Action:Destroy group
- Action:Destroy all
Set operations
These actions are set operations.
These actions are set operations.
- Action:A + B
- Action:A - B
- Action:A AND B
- Condition:Is a subset
- Condition:Empty
List/array operations
A list/array support these actions, or expressions.
A list/array support these actions, or expressions.
Push
- Action:Insert instances
- Action:Insert instance by UID
- Action:Push instances
- Action:Push instance by UID
Pop
- Action:Pop one instance
- Condition:Pop one instance
- Expression:Pop
- Action:Slice
List
- Action:Sort by UID increasement
- Action:Sort by UID decreasement
- Action:Sort by function, see next section for more detail.
- Action:Shuffle
- Action:Reverse
Get UID in a list
"Expression:Index2UID" could get UID by index. Or get first instance UID by "Expression:FirstUID", last instance UID by "Expression:LastUID". Return (-1) if instance is not in gropp.
"Expression:UID2Index" could get index by UID. Return (-1) if instance is not in gropp.
"Expression:Index2UID" could get UID by index. Or get first instance UID by "Expression:FirstUID", last instance UID by "Expression:LastUID". Return (-1) if instance is not in gropp.
"Expression:UID2Index" could get index by UID. Return (-1) if instance is not in gropp.
Sorting by function
"Action:Sort by function" could sort the instances by custom events.
"Action:Sort by function" could sort the instances by custom events.
- Call "Action:Sort by function".
- "Condition:On sorting" will be triggered.
- User could use "Expression:CmpUIDA", "Expression:CmpUIDB" to pick compared instances
- Use "Action:Set compared result", or "Action:Set compared result by number" to set compared result.
Travel in a list
"Condition:For each UID" could travel in a list, "Expression:Item", and "Expression:Index" could be used under this condition to get uid or index.
"Condition:For each UID" could travel in a list, "Expression:Item", and "Expression:Index" could be used under this condition to get uid or index.
SOL
"Action:Pick instances", or "Condition:Pick instances" could pick instances of the group. Other pop actions/conditions are list at previous section.
Note that, the picking mechanism is picking instances by UID, not picking under current SOL, so that it could pick the created instances. This picking result will be different from "pick all", "for each object" ,etc, after creating object. It will be similar with "pick by UID", which could pick created instance, too.
"Action:Pick instances", or "Condition:Pick instances" could pick instances of the group. Other pop actions/conditions are list at previous section.
Note that, the picking mechanism is picking instances by UID, not picking under current SOL, so that it could pick the created instances. This picking result will be different from "pick all", "for each object" ,etc, after creating object. It will be similar with "pick by UID", which could pick created instance, too.
Pass SOL into function
Sample capx
The SOL feature of this plugin could be used to pass SOL into function, since the SOL will be "pick all" while jumped into "on function". Moreover, it could be used to pass picking result out of "on function".
Sample capx
The SOL feature of this plugin could be used to pass SOL into function, since the SOL will be "pick all" while jumped into "on function". Moreover, it could be used to pass picking result out of "on function".
Mapping function
These conditions, actions, or expressions will pick an instance or sort instances in a group by the result of mapping function.
The mapping result is got by "Action:Set mapping result" under "Condition:On mapping" with "Expression:MapUID"
The mapping result is got by "Action:Set mapping result" under "Condition:On mapping" with "Expression:MapUID"
Pop one instance
Sample capx
"Condition:Pop by mapping result" or "Action:Pop by mapping result" will get or pop one instance which has the minimum or maximum mapping result.
Sample capx
"Condition:Pop by mapping result" or "Action:Pop by mapping result" will get or pop one instance which has the minimum or maximum mapping result.
Others
"Condition:UID in group" could test if an uid is in the group. "Action:Copy" could copy group.
"Condition:UID in group" could test if an uid is in the group. "Action:Copy" could copy group.
Destroy instances in group
Sample capx
"Action:Destroy instances", destroy all instances in a group without picking them.
Sample capx
"Action:Destroy instances", destroy all instances in a group without picking them.
Private group
"Expression: PrivateGroup" could return a special group name formatted by
"Expression: PrivateGroup" could return a special group name formatted by
"@" + uid + "$" + name
Group which created by this kind of name will be destroyed automatically when instance had been destroyed.
For example, group "@10$aa","@10$bb" will be destroyed automatically when instance with (uid=10) has been destroyed.
For example, group "@10$aa","@10$bb" will be destroyed automatically when instance with (uid=10) has been destroyed.
Save&Load
This plugin support official save/load system, so that it could be saved&loaded automatically.
"Expression:GroupToString" could dump content of group in list type by JSON string. Get all groups in JSON string by "Expression:AllToString".
This plugin support official save/load system, so that it could be saved&loaded automatically.
"Expression:GroupToString" could dump content of group in list type by JSON string. Get all groups in JSON string by "Expression:AllToString".