|
@@ -68,15 +68,24 @@ class AnimGraphInstance extends h3d.anim.Animation {
|
|
static function cloneRec(node: hrt.animgraph.Node, inst: AnimGraphInstance) : hrt.animgraph.Node {
|
|
static function cloneRec(node: hrt.animgraph.Node, inst: AnimGraphInstance) : hrt.animgraph.Node {
|
|
var cloned = hrt.animgraph.Node.createFromDynamic(node.serializeToDynamic());
|
|
var cloned = hrt.animgraph.Node.createFromDynamic(node.serializeToDynamic());
|
|
|
|
|
|
|
|
+ for (inputInfo in node.getInputs()) {
|
|
|
|
+ var val = Reflect.getProperty(node, inputInfo.name);
|
|
|
|
+ if (val != null) {
|
|
|
|
+ Reflect.setProperty(cloned, inputInfo.name, val);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
var clonedParam = Std.downcast(cloned, hrt.animgraph.nodes.FloatParameter);
|
|
var clonedParam = Std.downcast(cloned, hrt.animgraph.nodes.FloatParameter);
|
|
if (clonedParam != null) {
|
|
if (clonedParam != null) {
|
|
var nodeParam : hrt.animgraph.nodes.FloatParameter = cast node;
|
|
var nodeParam : hrt.animgraph.nodes.FloatParameter = cast node;
|
|
- clonedParam.parameter = inst.parameterMap.getOrPut(nodeParam.parameter.name, {
|
|
|
|
- var newParam = new hrt.animgraph.AnimGraph.Parameter();
|
|
|
|
- @:privateAccess newParam.copyFromOther(nodeParam.parameter);
|
|
|
|
- newParam.runtimeValue = nodeParam.parameter.defaultValue;
|
|
|
|
- newParam;
|
|
|
|
- });
|
|
|
|
|
|
+ if (nodeParam.parameter != null) {
|
|
|
|
+ clonedParam.parameter = inst.parameterMap.getOrPut(nodeParam.parameter.name, {
|
|
|
|
+ var newParam = new hrt.animgraph.AnimGraph.Parameter();
|
|
|
|
+ @:privateAccess newParam.copyFromOther(nodeParam.parameter);
|
|
|
|
+ newParam.runtimeValue = nodeParam.parameter.defaultValue;
|
|
|
|
+ newParam;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
for (id => edge in node.inputEdges) {
|
|
for (id => edge in node.inputEdges) {
|