@@ -685,9 +685,9 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
||||
case 36:
|
||||
{
|
||||
// Get value with structure data
|
||||
Variant structureValue = eatBox(node, node->GetBox(0)->FirstConnection());
|
||||
if (!node->GetBox(0)->HasConnection())
|
||||
return;
|
||||
Variant structureValue = eatBox(node, node->GetBox(0)->FirstConnection());
|
||||
|
||||
// Find type
|
||||
const StringView typeName(node->Values[0]);
|
||||
@@ -741,6 +741,12 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
||||
return;
|
||||
}
|
||||
const ScriptingType& type = typeHandle.GetType();
|
||||
if (structureValue.Type.Type != VariantType::Structure) // If structureValue is eg. Float we can try to cast it to a required structure type
|
||||
{
|
||||
VariantType typeVariantType(typeNameAnsiView);
|
||||
if (Variant::CanCast(structureValue, typeVariantType))
|
||||
structureValue = Variant::Cast(structureValue, typeVariantType);
|
||||
}
|
||||
structureValue.InvertInline(); // Extract any Float3/Int32 into Structure type from inlined format
|
||||
const ScriptingTypeHandle structureValueTypeHandle = Scripting::FindScriptingType(structureValue.Type.GetTypeName());
|
||||
if (structureValue.Type.Type != VariantType::Structure || typeHandle != structureValueTypeHandle)
|
||||
|
||||
Reference in New Issue
Block a user