diff --git a/Bundled/default_logic.json b/Bundled/default_logic.json new file mode 100644 index 00000000..4797685d --- /dev/null +++ b/Bundled/default_logic.json @@ -0,0 +1 @@ +{"nodes":[],"links":[]} \ No newline at end of file diff --git a/Bundled/logic_nodes.json b/Bundled/logic_nodes.json new file mode 100644 index 00000000..b2fc017b --- /dev/null +++ b/Bundled/logic_nodes.json @@ -0,0 +1 @@ +{"categories": [{"nodes": [{"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "STRING", "name": "Group"}], "type": "AddGroupNode", "name": "Add Group", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "SHADER", "name": "Trait"}], "type": "AddTraitNode", "name": "Add Trait", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "SHADER", "name": "Transform"}], "type": "AppendTransformNode", "name": "Append Transform", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}], "type": "CallGroupNode", "name": "Call Node Group", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "BOOL", "name": "Keep Transform"}], "type": "ClearParentNode", "name": "Clear Parent", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}], "type": "GroupOutputNode", "name": "Node Group Output", "outputs": []}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "SHADER", "name": "Value"}], "type": "PrintNode", "name": "Print", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}], "type": "RemoveActiveSceneNode", "name": "Remove Active Scene", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "STRING", "name": "Group"}], "type": "RemoveGroupNode", "name": "Remove Group", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}], "type": "RemoveObjectNode", "name": "Remove Object", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "SHADER", "name": "Trait"}], "type": "RemoveTraitNode", "name": "Remove Trait", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Vector"}], "type": "RotateObjectNode", "name": "Rotate Object", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Vector"}], "type": "ScaleObjectNode", "name": "Scale Object", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "STRING", "name": "Event"}, {"type": "OBJECT", "name": "Object"}], "type": "SendEventNode", "name": "Send Event", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "STRING", "name": "Event"}], "type": "SendGlobalEventNode", "name": "Send Global Event", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VALUE", "name": "FOV"}], "type": "SetCameraFovNode", "name": "Set Camera FOV", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Location"}], "type": "SetLocationNode", "name": "Set Location", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "SHADER", "name": "Material"}], "type": "SetMaterialNode", "name": "Set Material", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "SHADER", "name": "Material"}, {"type": "STRING", "name": "Node"}, {"type": "STRING", "name": "Image"}], "type": "SetMaterialImageParamNode", "name": "Set Material Image Param", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "SHADER", "name": "Material"}, {"type": "STRING", "name": "Node"}, {"type": "RGBA", "name": "Color"}], "type": "SetMaterialRgbParamNode", "name": "Set Material RGB Param", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "SHADER", "name": "Material"}, {"type": "INTEGER", "name": "Slot"}], "type": "SetMaterialSlotNode", "name": "Set Material Slot", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "SHADER", "name": "Material"}, {"type": "STRING", "name": "Node"}, {"type": "VALUE", "name": "Value"}], "type": "SetMaterialValueParamNode", "name": "Set Material Value Param", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "SHADER", "name": "Mesh"}], "type": "SetMeshNode", "name": "Set Mesh", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "STRING", "name": "Name"}], "type": "SetNameNode", "name": "Set Name", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "OBJECT", "name": "Parent"}], "type": "SetParentNode", "name": "Set Parent", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "OBJECT", "name": "Parent"}, {"type": "STRING", "name": "Bone"}], "type": "SetParentBoneNode", "name": "Set Parent Bone", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "STRING", "name": "Property"}, {"type": "SHADER", "name": "Value"}], "type": "SetPropertyNode", "name": "Set Property", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Rotation"}], "type": "SetRotationNode", "name": "Set Rotation", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Scale"}], "type": "SetScaleNode", "name": "Set Scale", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "SHADER", "name": "Scene"}], "type": "SetSceneNode", "name": "Set Scene", "outputs": [{"type": "ACTION", "name": "Out"}, {"type": "OBJECT", "name": "Root"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "VALUE", "name": "Scale"}], "type": "SetTimeScaleNode", "name": "Set Time Scale", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "SHADER", "name": "Transform"}], "type": "SetTransformNode", "name": "Set Transform", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "SHADER", "name": "Variable"}, {"type": "SHADER", "name": "Value"}], "type": "SetVariableNode", "name": "Set Variable", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "BOOL", "name": "Bool"}], "type": "SetVisibleNode", "name": "Set Visible", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "VALUE", "name": "Time"}], "type": "SleepNode", "name": "Sleep", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "SHADER", "name": "Transform"}], "type": "SpawnObjectNode", "name": "Spawn Object", "outputs": [{"type": "ACTION", "name": "Out"}, {"type": "OBJECT", "name": "Object"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "SHADER", "name": "Scene"}, {"type": "SHADER", "name": "Transform"}], "type": "SpawnSceneNode", "name": "Spawn Scene", "outputs": [{"type": "ACTION", "name": "Out"}, {"type": "OBJECT", "name": "Root"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Vector"}], "type": "TranslateObjectNode", "name": "Translate Object", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VALUE", "name": "Speed"}, {"type": "INTEGER", "name": "Forward/Up/Right"}, {"type": "BOOL", "name": "Inverse"}], "type": "TranslateOnLocalAxisNode", "name": "Translate On Local Axis", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "STRING", "name": "Key"}, {"type": "SHADER", "name": "Value"}], "type": "WriteStorageNode", "name": "Write Storage", "outputs": [{"type": "ACTION", "name": "Out"}]}], "name": "Action"}, {"nodes": [{"buttons": [{"default_value": 0, "data": ["Enter", "Leave", "Overlap"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "OBJECT", "name": "Object"}, {"type": "OBJECT", "name": "Volume"}], "type": "VolumeTriggerNode", "name": "Volume Trigger", "outputs": [{"type": "BOOL", "name": "Bool"}]}, {"buttons": [], "inputs": [], "type": "ActiveCameraNode", "name": "Active Camera", "outputs": [{"type": "OBJECT", "name": "Object"}]}, {"buttons": [], "inputs": [], "type": "ActiveSceneNode", "name": "Active Scene", "outputs": [{"type": "SHADER", "name": "Scene"}]}, {"buttons": [{"default_value": 0, "data": ["Equal", "Not Equal", "Less Than", "Less Than or Equal", "Greater Than", "Greater Than or Equal"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "SHADER", "name": "Value"}, {"type": "SHADER", "name": "Value"}], "type": "CompareNode", "name": "Compare", "outputs": [{"type": "BOOL", "name": "Bool"}]}, {"buttons": [], "inputs": [{"type": "STRING", "name": "Input 0"}], "type": "ConcatenateStringNode", "name": "Concatenate String", "outputs": [{"type": "STRING", "name": "String"}]}, {"buttons": [{"default_value": 0, "data": ["Contains", "Starts With", "Ends With"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "STRING", "name": "String"}, {"type": "STRING", "name": "Find"}], "type": "ContainsStringNode", "name": "Contains String", "outputs": [{"type": "BOOL", "name": "Bool"}]}, {"buttons": [], "inputs": [{"type": "VALUE", "name": "Degrees"}], "type": "DegToRadNode", "name": "Deg to Rad", "outputs": [{"type": "VALUE", "name": "Radians"}]}, {"buttons": [], "inputs": [], "type": "DisplayInfoNode", "name": "Display Info", "outputs": [{"type": "INTEGER", "name": "Width"}, {"type": "INTEGER", "name": "Height"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetCameraFovNode", "name": "Get Camera FOV", "outputs": [{"type": "VALUE", "name": "FOV"}]}, {"buttons": [{"default_value": 0, "data": ["By Name", "Contains", "Starts With", "Ends With"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "OBJECT", "name": "Object"}, {"type": "STRING", "name": "Child"}], "type": "GetChildNode", "name": "Get Child", "outputs": [{"type": "OBJECT", "name": "Object"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetChildrenNode", "name": "Get Children", "outputs": [{"type": "ARRAY", "name": "Array"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}, {"type": "OBJECT", "name": "Object"}], "type": "GetDistanceNode", "name": "Get Distance", "outputs": [{"type": "VALUE", "name": "Distance"}]}, {"buttons": [], "inputs": [{"type": "STRING", "name": "Name"}], "type": "GetGroupNode", "name": "Get Group", "outputs": [{"type": "ARRAY", "name": "Array"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetLocationNode", "name": "Get Location", "outputs": [{"type": "VECTOR", "name": "Location"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetMaterialNode", "name": "Get Material", "outputs": [{"type": "SHADER", "name": "Material"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetMeshNode", "name": "Get Mesh", "outputs": [{"type": "SHADER", "name": "Mesh"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetNameNode", "name": "Get Name", "outputs": [{"type": "STRING", "name": "Name"}]}, {"buttons": [], "inputs": [{"type": "STRING", "name": "Name"}], "type": "GetObjectNode", "name": "Get Object", "outputs": [{"type": "OBJECT", "name": "Object"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetParentNode", "name": "Get Parent", "outputs": [{"type": "OBJECT", "name": "Object"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}, {"type": "STRING", "name": "Property"}], "type": "GetPropertyNode", "name": "Get Property", "outputs": [{"type": "SHADER", "name": "Value"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetRotationNode", "name": "Get Rotation", "outputs": [{"type": "VECTOR", "name": "Rotation"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetScaleNode", "name": "Get Scale", "outputs": [{"type": "VECTOR", "name": "Scale"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}, {"type": "STRING", "name": "Name"}], "type": "GetTraitNode", "name": "Get Trait", "outputs": [{"type": "SHADER", "name": "Trait"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetTransformNode", "name": "Get Transform", "outputs": [{"type": "SHADER", "name": "Transform"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetVisibleNode", "name": "Get Visible", "outputs": [{"type": "BOOL", "name": "Visible"}]}, {"buttons": [], "inputs": [{"type": "VECTOR", "name": "From Location"}, {"type": "VECTOR", "name": "To Location"}], "type": "LookAtNode", "name": "Look At", "outputs": [{"type": "VECTOR", "name": "Rotation"}]}, {"buttons": [{"default_value": 0, "data": ["Add", "Multiply", "Sine", "Cosine", "Max", "Min", "Abs", "Subtract", "Divide", "Tangent", "Arcsine", "Arccosine", "Arctangent", "Power", "Logarithm", "Round", "Less Than", "Greater Than", "Modulo"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "VALUE", "name": "Value"}, {"type": "VALUE", "name": "Value"}], "type": "MathNode", "name": "Math", "outputs": [{"type": "VALUE", "name": "Value"}]}, {"buttons": [{"default_value": 0, "data": ["Multiply"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "SHADER", "name": "Matrix"}, {"type": "SHADER", "name": "Matrix"}], "type": "MatrixMathNode", "name": "Matrix Math", "outputs": [{"type": "SHADER", "name": "Matrix"}]}, {"buttons": [{"default_value": 0, "data": ["Linear", "Sine", "Quad", "Cubic", "Quart", "Quint", "Expo", "Circ", "Back"], "type": "ENUM", "name": "property("}, {"default_value": 0, "data": ["In", "Out", "InOut"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "VALUE", "name": "Factor"}, {"type": "VALUE", "name": "Value1"}, {"type": "VALUE", "name": "Value2"}], "type": "MixNode", "name": "Mix", "outputs": [{"type": "VALUE", "name": "Value"}]}, {"buttons": [], "inputs": [], "type": "NoneNode", "name": "None", "outputs": [{"type": "SHADER", "name": "None"}]}, {"buttons": [], "inputs": [{"type": "VALUE", "name": "Radians"}], "type": "RadToDegNode", "name": "Rad to Deg", "outputs": [{"type": "VALUE", "name": "Degrees"}]}, {"buttons": [], "inputs": [], "type": "RandomBooleanNode", "name": "Random (Boolean)", "outputs": [{"type": "BOOL", "name": "Bool"}]}, {"buttons": [], "inputs": [], "type": "RandomColorNode", "name": "Random (Color)", "outputs": [{"type": "RGBA", "name": "Color"}]}, {"buttons": [], "inputs": [{"type": "VALUE", "name": "Min"}, {"type": "VALUE", "name": "Max"}], "type": "RandomFloatNode", "name": "Random (Float)", "outputs": [{"type": "VALUE", "name": "Float"}]}, {"buttons": [], "inputs": [{"type": "INTEGER", "name": "Min"}, {"type": "INTEGER", "name": "Max"}], "type": "RandomIntegerNode", "name": "Random (Integer)", "outputs": [{"type": "INTEGER", "name": "Int"}]}, {"buttons": [], "inputs": [{"type": "VECTOR", "name": "Min"}, {"type": "VECTOR", "name": "Max"}], "type": "RandomVectorNode", "name": "Random (Vector)", "outputs": [{"type": "VECTOR", "name": "Vector"}]}, {"buttons": [], "inputs": [{"type": "STRING", "name": "Key"}, {"type": "STRING", "name": "Default"}], "type": "ReadStorageNode", "name": "Read Storage", "outputs": [{"type": "SHADER", "name": "Value"}]}, {"buttons": [], "inputs": [{"type": "VECTOR", "name": "Vector"}], "type": "ScreenToWorldSpaceNode", "name": "Screen To World Space", "outputs": [{"type": "VECTOR", "name": "Vector"}]}, {"buttons": [], "inputs": [], "type": "SelfNode", "name": "Self", "outputs": [{"type": "OBJECT", "name": "Object"}]}, {"buttons": [], "inputs": [], "type": "SelfTraitNode", "name": "Self Trait", "outputs": [{"type": "SHADER", "name": "Trait"}]}, {"buttons": [], "inputs": [{"type": "RGBA", "name": "Color"}], "type": "SeparateColorNode", "name": "Separate RGB", "outputs": [{"type": "VALUE", "name": "R"}, {"type": "VALUE", "name": "G"}, {"type": "VALUE", "name": "B"}]}, {"buttons": [], "inputs": [{"type": "SHADER", "name": "Transform"}], "type": "SeparateTransformNode", "name": "Separate Transform", "outputs": [{"type": "VECTOR", "name": "Location"}, {"type": "VECTOR", "name": "Rotation"}, {"type": "VECTOR", "name": "Scale"}]}, {"buttons": [], "inputs": [{"type": "VECTOR", "name": "Vector"}], "type": "SeparateVectorNode", "name": "Separate XYZ", "outputs": [{"type": "VALUE", "name": "X"}, {"type": "VALUE", "name": "Y"}, {"type": "VALUE", "name": "Z"}]}, {"buttons": [], "inputs": [], "type": "TimeNode", "name": "Time", "outputs": [{"type": "VALUE", "name": "Time"}, {"type": "VALUE", "name": "Delta"}]}, {"buttons": [], "inputs": [{"type": "VECTOR", "name": "Vector"}, {"type": "VALUE", "name": "Min"}, {"type": "VALUE", "name": "Max"}], "type": "VectorClampToSizeNode", "name": "Vector Clamp To Size", "outputs": [{"type": "VECTOR", "name": "Vector"}]}, {"buttons": [{"default_value": 0, "data": ["Up", "Right", "Look", "Quaternion"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "SHADER", "name": "Transform"}], "type": "VectorFromTransformNode", "name": "Vector From Transform", "outputs": [{"type": "VECTOR", "name": "Vector"}]}, {"buttons": [{"default_value": 0, "data": ["Add", "Dot Product", "Multiply", "Normalize", "Subtract", "Average", "Cross Product", "Length"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "VECTOR", "name": "Vector"}, {"type": "VECTOR", "name": "Vector"}], "type": "VectorMathNode", "name": "Vector Math", "outputs": [{"type": "VECTOR", "name": "Vector"}, {"type": "VALUE", "name": "Value"}]}, {"buttons": [{"default_value": 0, "data": ["Linear", "Sine", "Quad", "Cubic", "Quart", "Quint", "Expo", "Circ", "Back"], "type": "ENUM", "name": "property("}, {"default_value": 0, "data": ["In", "Out", "InOut"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "VALUE", "name": "Factor"}, {"type": "VECTOR", "name": "Vector1"}, {"type": "VECTOR", "name": "Vector2"}], "type": "VectorMixNode", "name": "Vector Mix", "outputs": [{"type": "VECTOR", "name": "Vector"}]}, {"buttons": [], "inputs": [], "type": "WindowInfoNode", "name": "Window Info", "outputs": [{"type": "INTEGER", "name": "Width"}, {"type": "INTEGER", "name": "Height"}]}, {"buttons": [], "inputs": [{"type": "VECTOR", "name": "Vector"}], "type": "WorldToScreenSpaceNode", "name": "World To Screen Space", "outputs": [{"type": "VECTOR", "name": "Vector"}]}], "name": "Value"}, {"nodes": [{"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "AnimationStateNode", "name": "Animation State", "outputs": [{"type": "BOOL", "name": "Is Playing"}, {"type": "STRING", "name": "Action"}, {"type": "INTEGER", "name": "Frame"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}, {"type": "STRING", "name": "Marker"}], "type": "OnActionMarkerNode", "name": "On Action Marker", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}], "type": "PauseActionNode", "name": "Pause Action", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}], "type": "PauseTilesheetNode", "name": "Pause Tilesheet", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "ANIMACTION", "name": "Action"}, {"type": "VALUE", "name": "Blend"}], "type": "PlayActionNode", "name": "Play Action", "outputs": [{"type": "ACTION", "name": "Out"}, {"type": "ACTION", "name": "Done"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "STRING", "name": "Action"}], "type": "PlayTilesheetNode", "name": "Play Tilesheet", "outputs": [{"type": "ACTION", "name": "Out"}, {"type": "ACTION", "name": "Done"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}], "type": "ResumeActionNode", "name": "Resume Action", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}], "type": "ResumeTilesheetNode", "name": "Resume Tilesheet", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VALUE", "name": "Speed"}], "type": "SetActionSpeedNode", "name": "Set Action Speed", "outputs": [{"type": "ACTION", "name": "Out"}]}], "name": "Animation"}, {"nodes": [{"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "ARRAY", "name": "Array"}, {"type": "SHADER", "name": "Value"}], "type": "ArrayAddNode", "name": "Array Add", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "ARRAY", "name": "Array"}, {"type": "SHADER", "name": "Value"}], "type": "ArrayAddUniqueNode", "name": "Array Add Unique", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Index"}], "type": "ArrayGetNode", "name": "Array Get", "outputs": [{"type": "SHADER", "name": "Value"}]}, {"buttons": [], "inputs": [{"type": "ARRAY", "name": "Array"}], "type": "ArrayLengthNode", "name": "Array Length", "outputs": [{"type": "INTEGER", "name": "Length"}]}, {"buttons": [], "inputs": [{"type": "ARRAY", "name": "Array"}], "type": "ArrayPopNode", "name": "Array Pop", "outputs": [{"type": "SHADER", "name": "Value"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Index"}], "type": "ArrayRemoveNode", "name": "Array Remove", "outputs": [{"type": "ACTION", "name": "Out"}, {"type": "SHADER", "name": "Value"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "ARRAY", "name": "Array"}, {"type": "SHADER", "name": "Value"}], "type": "ArrayRemoveValueNode", "name": "Array Remove Value", "outputs": [{"type": "ACTION", "name": "Out"}, {"type": "SHADER", "name": "Value"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Index"}, {"type": "SHADER", "name": "Value"}], "type": "ArraySetNode", "name": "Array Set", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ARRAY", "name": "Array"}], "type": "ArrayShiftNode", "name": "Array Shift", "outputs": [{"type": "SHADER", "name": "Value"}]}, {"buttons": [], "inputs": [{"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Index"}, {"type": "INTEGER", "name": "End"}], "type": "ArraySliceNode", "name": "Array Slice", "outputs": [{"type": "ARRAY", "name": "Array"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Index"}, {"type": "INTEGER", "name": "Length"}], "type": "ArraySpliceNode", "name": "Array Splice", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [], "type": "ArrayNode", "name": "Array", "outputs": [{"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Length"}]}, {"buttons": [], "inputs": [], "type": "ArrayBooleanNode", "name": "Array (Boolean)", "outputs": [{"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Length"}]}, {"buttons": [], "inputs": [], "type": "ArrayColorNode", "name": "Array (Color)", "outputs": [{"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Length"}]}, {"buttons": [], "inputs": [], "type": "ArrayFloatNode", "name": "Array (Float)", "outputs": [{"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Length"}]}, {"buttons": [], "inputs": [], "type": "ArrayIntegerNode", "name": "Array (Integer)", "outputs": [{"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Length"}]}, {"buttons": [], "inputs": [], "type": "ArrayObjectNode", "name": "Array (Object)", "outputs": [{"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Length"}]}, {"buttons": [], "inputs": [], "type": "ArrayStringNode", "name": "Array (String)", "outputs": [{"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Length"}]}, {"buttons": [], "inputs": [], "type": "ArrayVectorNode", "name": "Array (Vector)", "outputs": [{"type": "ARRAY", "name": "Array"}, {"type": "INTEGER", "name": "Length"}]}], "name": "Array"}, {"nodes": [{"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "STRING", "name": "Element"}, {"type": "STRING", "name": "Text"}], "type": "CanvasSetTextNode", "name": "Canvas Set Text", "outputs": [{"type": "ACTION", "name": "Out"}]}], "name": "Canvas"}, {"nodes": [{"buttons": [], "inputs": [], "type": "OnEventNode", "name": "On Event", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [], "type": "OnInitNode", "name": "On Init", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "VALUE", "name": "Duration"}, {"type": "BOOL", "name": "Repeat"}], "type": "OnTimerNode", "name": "On Timer", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [], "type": "OnUpdateNode", "name": "On Update", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [{"default_value": 0, "data": ["Enter", "Leave", "Overlap"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "OBJECT", "name": "Object"}, {"type": "OBJECT", "name": "Volume"}], "type": "OnVolumeTriggerNode", "name": "On Volume Trigger", "outputs": [{"type": "ACTION", "name": "Out"}]}], "name": "Event"}, {"nodes": [{"buttons": [{"default_value": 0, "data": ["Down", "Started", "Released", "Moved Left", "Moved Right"], "type": "ENUM", "name": "property("}, {"default_value": 0, "data": ["cross", "circle", "square", "triangle", "l1", "r1", "l2", "r2", "share", "options", "l3", "r3", "up", "down", "left", "right", "home", "touchpad"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "INTEGER", "name": "Gamepad"}], "type": "GamepadNode", "name": "Gamepad State", "outputs": [{"type": "VALUE", "name": "Value"}]}, {"buttons": [], "inputs": [{"type": "INTEGER", "name": "Gamepad"}], "type": "GamepadCoordsNode", "name": "Gamepad Coords", "outputs": [{"type": "VECTOR", "name": "Left Stick"}, {"type": "VECTOR", "name": "Right Stick"}, {"type": "VECTOR", "name": "Left Movement"}, {"type": "VECTOR", "name": "Right Movement"}]}, {"buttons": [{"default_value": 0, "data": ["Down", "Started", "Released"], "type": "ENUM", "name": "property("}, {"default_value": 0, "data": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", ",", "space", "backspace", "tab", "return", "shift", "control", "alt", "escape", "delete", "back", "up", "right", "left", "down"], "type": "ENUM", "name": "property("}], "inputs": [], "type": "KeyboardNode", "name": "Keyboard State", "outputs": [{"type": "BOOL", "name": "State"}]}, {"buttons": [{"default_value": 0, "data": ["Down", "Started", "Released", "Moved"], "type": "ENUM", "name": "property("}, {"default_value": 0, "data": ["left", "right", "middle"], "type": "ENUM", "name": "property("}], "inputs": [], "type": "MouseNode", "name": "Mouse State", "outputs": [{"type": "BOOL", "name": "State"}]}, {"buttons": [], "inputs": [], "type": "MouseCoordsNode", "name": "Mouse Coords", "outputs": [{"type": "VECTOR", "name": "Coords"}, {"type": "VECTOR", "name": "Movement"}, {"type": "INTEGER", "name": "Wheel"}]}, {"buttons": [{"default_value": 0, "data": ["Down", "Started", "Released", "Moved Left", "Moved Right"], "type": "ENUM", "name": "property("}, {"default_value": 0, "data": ["cross", "circle", "square", "triangle", "l1", "r1", "l2", "r2", "share", "options", "l3", "r3", "up", "down", "left", "right", "home", "touchpad"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "INTEGER", "name": "Gamepad"}], "type": "OnGamepadNode", "name": "On Gamepad", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [{"default_value": 0, "data": ["Down", "Started", "Released"], "type": "ENUM", "name": "property("}, {"default_value": 0, "data": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", ",", "space", "backspace", "tab", "return", "shift", "control", "alt", "escape", "delete", "back", "up", "right", "left", "down"], "type": "ENUM", "name": "property("}], "inputs": [], "type": "OnKeyboardNode", "name": "On Keyboard", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [{"default_value": 0, "data": ["Down", "Started", "Released", "Moved"], "type": "ENUM", "name": "property("}, {"default_value": 0, "data": ["left", "right", "middle"], "type": "ENUM", "name": "property("}], "inputs": [], "type": "OnMouseNode", "name": "On Mouse", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [{"default_value": 0, "data": ["Touched", "Started", "Released", "Moved"], "type": "ENUM", "name": "property("}], "inputs": [], "type": "OnSurfaceNode", "name": "On Surface", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [{"default_value": 0, "data": ["Down", "Started", "Released"], "type": "ENUM", "name": "property("}], "inputs": [], "type": "OnVirtualButtonNode", "name": "On Virtual Button", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [], "type": "SensorCoordsNode", "name": "Sensor Coords", "outputs": [{"type": "VECTOR", "name": "Coords"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "BOOL", "name": "Lock"}], "type": "SetMouseLockNode", "name": "Set Mouse Lock", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "BOOL", "name": "Show"}], "type": "ShowMouseNode", "name": "Show Mouse", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [{"default_value": 0, "data": ["Touched", "Started", "Released", "Moved"], "type": "ENUM", "name": "property("}], "inputs": [], "type": "SurfaceNode", "name": "Surface State", "outputs": [{"type": "BOOL", "name": "State"}]}, {"buttons": [], "inputs": [], "type": "SurfaceCoordsNode", "name": "Surface Coords", "outputs": [{"type": "VECTOR", "name": "Coords"}, {"type": "VECTOR", "name": "Movement"}]}, {"buttons": [{"default_value": 0, "data": ["Down", "Started", "Released"], "type": "ENUM", "name": "property("}], "inputs": [], "type": "VirtualButtonNode", "name": "Virtual Button", "outputs": [{"type": "BOOL", "name": "State"}]}], "name": "Input"}, {"nodes": [{"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}], "type": "AlternateNode", "name": "Alternate", "outputs": [{"type": "ACTION", "name": "0"}, {"type": "ACTION", "name": "1"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "ARRAY", "name": "Array"}], "type": "ArrayLoopNode", "name": "Array Loop", "outputs": [{"type": "ACTION", "name": "Loop"}, {"type": "INTEGER", "name": "Value"}, {"type": "ACTION", "name": "Done"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "BOOL", "name": "Bool"}], "type": "BranchNode", "name": "Branch", "outputs": [{"type": "ACTION", "name": "True"}, {"type": "ACTION", "name": "False"}]}, {"buttons": [{"default_value": 0, "data": ["Equal", "Almost Equal", "Greater", "Greater Equal", "Less", "Less Equal", "Or", "And", ""], "type": "ENUM", "name": "property("}], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "SHADER", "name": "Value"}, {"type": "SHADER", "name": "Value"}], "type": "GateNode", "name": "Gate", "outputs": [{"type": "ACTION", "name": "True"}, {"type": "ACTION", "name": "False"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}], "type": "InverseNode", "name": "Inverse", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "BOOL", "name": "Value"}], "type": "IsFalseNode", "name": "Is False", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "SHADER", "name": "Value"}], "type": "IsNoneNode", "name": "Is None", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "SHADER", "name": "Value"}], "type": "IsNotNoneNode", "name": "Is Not None", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "BOOL", "name": "Value"}], "type": "IsTrueNode", "name": "Is True", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "INTEGER", "name": "From"}, {"type": "INTEGER", "name": "To"}], "type": "LoopNode", "name": "Loop", "outputs": [{"type": "ACTION", "name": "Loop"}, {"type": "INTEGER", "name": "Index"}, {"type": "ACTION", "name": "Done"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}], "type": "LoopBreakNode", "name": "Loop Break", "outputs": []}, {"buttons": [], "inputs": [], "type": "MergeNode", "name": "Merge", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "BOOL", "name": "Value"}], "type": "NotNode", "name": "Not", "outputs": [{"type": "BOOL", "name": "Value"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}], "type": "SequenceNode", "name": "Sequence", "outputs": []}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}], "type": "ToBoolNode", "name": "To Bool", "outputs": [{"type": "BOOL", "name": "Bool"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "BOOL", "name": "Condition"}], "type": "WhileNode", "name": "While", "outputs": [{"type": "ACTION", "name": "Loop"}, {"type": "ACTION", "name": "Done"}]}], "name": "Logic"}, {"nodes": [{"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "STRING", "name": "Function"}], "type": "CallFunctionNode", "name": "Call Function", "outputs": [{"type": "ACTION", "name": "Out"}, {"type": "SHADER", "name": "Result"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "STRING", "name": "Function"}], "type": "CallStaticFunctionNode", "name": "Call Static Function", "outputs": [{"type": "ACTION", "name": "Out"}, {"type": "SHADER", "name": "Result"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}], "type": "ExpressionNode", "name": "Expression", "outputs": [{"type": "ACTION", "name": "Out"}, {"type": "SHADER", "name": "Result"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}, {"type": "STRING", "name": "Property"}], "type": "GetNativePropertyNode", "name": "Get Native Property", "outputs": [{"type": "SHADER", "name": "Value"}]}, {"buttons": [], "inputs": [{"type": "STRING", "name": "Class"}, {"type": "STRING", "name": "Property"}], "type": "GetStaticPropertyNode", "name": "Get Static Property", "outputs": [{"type": "SHADER", "name": "Value"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "ARRAY", "name": "Array"}], "type": "ScriptNode", "name": "Script", "outputs": [{"type": "ACTION", "name": "Out"}, {"type": "SHADER", "name": "Result"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "STRING", "name": "Property"}, {"type": "SHADER", "name": "Value"}], "type": "SetNativePropertyNode", "name": "Set Native Property", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "STRING", "name": "Class"}, {"type": "STRING", "name": "Property"}, {"type": "SHADER", "name": "Value"}], "type": "SetStaticPropertyNode", "name": "Set Static Property", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}], "type": "ShutdownNode", "name": "Shutdown", "outputs": [{"type": "ACTION", "name": "Out"}]}], "name": "Native"}, {"nodes": [{"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "SHADER", "name": "Location"}], "type": "GoToLocationNode", "name": "Go To Location", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [], "type": "NavigableLocationNode", "name": "Navigable Location", "outputs": [{"type": "SHADER", "name": "Location"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Navmesh"}, {"type": "VECTOR", "name": "Screen Coords"}], "type": "PickLocationNode", "name": "Pick Location", "outputs": [{"type": "VECTOR", "name": "Location"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}], "type": "StopAgentNode", "name": "Stop Agent", "outputs": [{"type": "ACTION", "name": "Out"}]}], "name": "Navmesh"}, {"nodes": [{"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Force"}], "type": "ApplyForceNode", "name": "Apply Force", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Force"}, {"type": "VECTOR", "name": "Location"}], "type": "ApplyForceAtLocationNode", "name": "Apply Force At Location", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Impulse"}], "type": "ApplyImpulseNode", "name": "Apply Impulse", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Impulse"}, {"type": "VECTOR", "name": "Location"}], "type": "ApplyImpulseAtLocationNode", "name": "Apply Impulse At Location", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "VECTOR", "name": "From"}, {"type": "VECTOR", "name": "To"}], "type": "CastPhysicsRayNode", "name": "Cast Physics Ray", "outputs": [{"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Hit"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetContactsNode", "name": "Get Contacts", "outputs": [{"type": "ARRAY", "name": "Array"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetFirstContactNode", "name": "Get First Contact", "outputs": [{"type": "OBJECT", "name": "Object"}]}, {"buttons": [], "inputs": [{"type": "VECTOR", "name": "Gravity"}], "type": "GetGravityNode", "name": "Get Gravity", "outputs": []}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "GetVelocityNode", "name": "Get Velocity", "outputs": [{"type": "VECTOR", "name": "Linear"}, {"type": "VECTOR", "name": "Angular"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object 1"}, {"type": "OBJECT", "name": "Object 2"}], "type": "HasContactNode", "name": "Has Contact", "outputs": [{"type": "BOOL", "name": "Bool"}]}, {"buttons": [{"default_value": 0, "data": ["Begin", "End", "Overlap"], "type": "ENUM", "name": "property("}], "inputs": [{"type": "OBJECT", "name": "Object 1"}, {"type": "OBJECT", "name": "Object 2"}], "type": "OnContactNode", "name": "On Contact", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "VECTOR", "name": "Screen Coords"}], "type": "PickObjectNode", "name": "Pick Object", "outputs": [{"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Hit"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "VECTOR", "name": "Gravity"}], "type": "SetGravityNode", "name": "Set Gravity", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Object"}, {"type": "VECTOR", "name": "Linear"}, {"type": "VECTOR", "name": "Linear Factor"}, {"type": "VECTOR", "name": "Angular"}, {"type": "VECTOR", "name": "Angular Factor"}], "type": "SetVelocityNode", "name": "Set Velocity", "outputs": [{"type": "ACTION", "name": "Out"}]}], "name": "Physics"}, {"nodes": [{"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Speaker"}], "type": "PauseSoundNode", "name": "Pause Speaker", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}], "type": "PlaySoundRawNode", "name": "Play Sound", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Speaker"}], "type": "PlaySoundNode", "name": "Play Speaker", "outputs": [{"type": "ACTION", "name": "Out"}]}, {"buttons": [], "inputs": [{"type": "ACTION", "name": "In"}, {"type": "OBJECT", "name": "Speaker"}], "type": "StopSoundNode", "name": "Stop Speaker", "outputs": [{"type": "ACTION", "name": "Out"}]}], "name": "Sound"}, {"nodes": [{"buttons": [], "inputs": [{"type": "ANIMACTION", "name": "Action"}], "type": "AnimActionNode", "name": "Action", "outputs": [{"type": "ANIMACTION", "name": "Action"}]}, {"buttons": [], "inputs": [{"type": "BOOL", "name": "Value"}], "type": "BooleanNode", "name": "Boolean", "outputs": [{"type": "BOOL", "name": "Bool"}]}, {"buttons": [], "inputs": [{"type": "RGBA", "name": "Color"}], "type": "ColorNode", "name": "Color", "outputs": [{"type": "RGBA", "name": "Color"}]}, {"buttons": [], "inputs": [], "type": "DynamicNode", "name": "Dynamic", "outputs": [{"type": "SHADER", "name": "Dynamic"}]}, {"buttons": [], "inputs": [{"type": "VALUE", "name": "Value"}], "type": "FloatNode", "name": "Float", "outputs": [{"type": "VALUE", "name": "Float"}]}, {"buttons": [], "inputs": [], "type": "GlobalObjectNode", "name": "Global Object", "outputs": [{"type": "OBJECT", "name": "Object"}]}, {"buttons": [], "inputs": [], "type": "GroupNode", "name": "Group", "outputs": [{"type": "ARRAY", "name": "Array"}]}, {"buttons": [], "inputs": [{"type": "INTEGER", "name": "Value"}], "type": "IntegerNode", "name": "Integer", "outputs": [{"type": "INTEGER", "name": "Int"}]}, {"buttons": [], "inputs": [], "type": "MaterialNode", "name": "Material", "outputs": [{"type": "SHADER", "name": "Material"}]}, {"buttons": [], "inputs": [], "type": "MeshNode", "name": "Mesh", "outputs": [{"type": "SHADER", "name": "Mesh"}]}, {"buttons": [], "inputs": [{"type": "OBJECT", "name": "Object"}], "type": "ObjectNode", "name": "Object", "outputs": [{"type": "OBJECT", "name": "Object"}]}, {"buttons": [], "inputs": [{"type": "VALUE", "name": "X"}, {"type": "VALUE", "name": "Y"}, {"type": "VALUE", "name": "Z"}, {"type": "VALUE", "name": "W"}], "type": "QuaternionNode", "name": "Quaternion", "outputs": [{"type": "VECTOR", "name": "Quaternion"}]}, {"buttons": [], "inputs": [], "type": "SceneNode", "name": "Scene", "outputs": [{"type": "SHADER", "name": "Scene"}]}, {"buttons": [], "inputs": [], "type": "SceneRootNode", "name": "Scene Root", "outputs": [{"type": "OBJECT", "name": "Object"}]}, {"buttons": [], "inputs": [{"type": "STRING", "name": "Value"}], "type": "StringNode", "name": "String", "outputs": [{"type": "STRING", "name": "String"}]}, {"buttons": [], "inputs": [], "type": "TraitNode", "name": "Trait", "outputs": [{"type": "SHADER", "name": "Trait"}]}, {"buttons": [], "inputs": [{"type": "VECTOR", "name": "Location"}, {"type": "VECTOR", "name": "Rotation"}, {"type": "VECTOR", "name": "Scale"}], "type": "TransformNode", "name": "Transform", "outputs": [{"type": "SHADER", "name": "Transform"}]}, {"buttons": [], "inputs": [{"type": "VALUE", "name": "X"}, {"type": "VALUE", "name": "Y"}, {"type": "VALUE", "name": "Z"}], "type": "VectorNode", "name": "Vector", "outputs": [{"type": "VECTOR", "name": "Vector"}]}], "name": "Variable"}]} \ No newline at end of file diff --git a/Sources/arm/NodeCreator.hx b/Sources/arm/NodeCreator.hx index 81129699..2b3d6751 100644 --- a/Sources/arm/NodeCreator.hx +++ b/Sources/arm/NodeCreator.hx @@ -142,162 +142,6 @@ class NodeCreator { nodes.nodeDrag = n; nodes.nodeSelected = n; } - // if (ui.button("Camera Data")) { - // var node_id = nodes.getNodeId(canvas.nodes); - // var n:TNode = { - // id: node_id, - // name: "Camera Data", - // type: "CAMERA", - // x: getNodeX(), - // y: getNodeY(), - // color: 0xff4982a0, - // inputs: [], - // outputs: [ - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "View Vector", - // type: "VECTOR", - // color: 0xff6363c7, - // default_value: [0.0, 0.0, 0.0] - // }, - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "View Z Depth", - // type: "VALUE", - // color: 0xffa1a1a1, - // default_value: 0.0 - // }, - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "View Distance", - // type: "VALUE", - // color: 0xffa1a1a1, - // default_value: 0.0 - // } - // ], - // buttons: [] - // }; - // canvas.nodes.push(n); - // nodes.nodeDrag = n; - // nodes.nodeSelected = n; - // } - // if (ui.button("Geometry")) { - // var node_id = nodes.getNodeId(canvas.nodes); - // var n:TNode = { - // id: node_id, - // name: "Geometry", - // type: "NEW_GEOMETRY", - // x: getNodeX(), - // y: getNodeY(), - // color: 0xff4982a0, - // inputs: [], - // outputs: [ - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "Position", - // type: "VECTOR", - // color: 0xff6363c7, - // default_value: [0.0, 0.0, 0.0] - // }, - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "Normal", - // type: "VECTOR", - // color: 0xff6363c7, - // default_value: [0.0, 0.0, 0.0] - // } - // ], - // buttons: [] - // }; - // canvas.nodes.push(n); - // nodes.nodeDrag = n; - // nodes.nodeSelected = n; - // } - // if (ui.button("Fresnel")) { - // var node_id = nodes.getNodeId(canvas.nodes); - // var n:TNode = { - // id: node_id, - // name: "Fresnel", - // type: "FRESNEL", - // x: getNodeX(), - // y: getNodeY(), - // color: 0xff4982a0, - // inputs: [ - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "IOR", - // type: "VALUE", - // color: 0xffa1a1a1, - // default_value: 1.450, - // min: 0.0, - // max: 2.0 - // } - // ], - // outputs: [ - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "Fac", - // type: "VALUE", - // color: 0xffa1a1a1, - // default_value: 0.0 - // } - // ], - // buttons: [] - // }; - // canvas.nodes.push(n); - // nodes.nodeDrag = n; - // nodes.nodeSelected = n; - // } - // if (ui.button("Layer Weight")) { - // var node_id = nodes.getNodeId(canvas.nodes); - // var n:TNode = { - // id: node_id, - // name: "Layer Weight", - // type: "LAYER_WEIGHT", - // x: getNodeX(), - // y: getNodeY(), - // color: 0xff4982a0, - // inputs: [ - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "Blend", - // type: "VALUE", - // color: 0xffa1a1a1, - // default_value: 0.5 - // } - // ], - // outputs: [ - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "Fresnel", - // type: "VALUE", - // color: 0xffa1a1a1, - // default_value: 0.0 - // }, - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "Facing", - // type: "VALUE", - // color: 0xffa1a1a1, - // default_value: 0.0 - // } - // ], - // buttons: [] - // }; - // canvas.nodes.push(n); - // nodes.nodeDrag = n; - // nodes.nodeSelected = n; - // } } if (cat == 1) { // Output if (ui.button("Material Output")) { @@ -990,43 +834,6 @@ class NodeCreator { nodes.nodeDrag = n; nodes.nodeSelected = n; } - // if (ui.button("Wavelength")) { - // var node_id = nodes.getNodeId(canvas.nodes); - // var n:TNode = { - // id: node_id, - // name: "Wavelength", - // type: "WAVELENGTH", - // x: getNodeX(), - // y: getNodeY(), - // color: 0xff4982a0, - // inputs: [ - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "Wavelength", - // type: "VALUE", - // color: 0xffa1a1a1, - // default_value: 500.0, - // min: 450.0, - // max: 600.0 - // } - // ], - // outputs: [ - // { - // id: nodes.getSocketId(canvas.nodes), - // node_id: node_id, - // name: "Color", - // type: "RGBA", - // color: 0xffc7c729, - // default_value: [0.8, 0.8, 0.8] - // } - // ], - // buttons: [] - // }; - // canvas.nodes.push(n); - // nodes.nodeDrag = n; - // nodes.nodeSelected = n; - // } if (ui.button("Mapping")) { var node_id = nodes.getNodeId(canvas.nodes); var n:TNode = { diff --git a/Sources/arm/NodeCreatorLogic.hx b/Sources/arm/NodeCreatorLogic.hx new file mode 100644 index 00000000..ef539dce --- /dev/null +++ b/Sources/arm/NodeCreatorLogic.hx @@ -0,0 +1,179 @@ +package arm; + +import armory.system.Cycles; + +typedef TNodeList = { + var categories: Array; +} + +typedef TCat = { + var name: String; + var nodes: Array; +} + +typedef TCatNode = { + var name: String; + var type: String; + var inputs: Array; + var outputs: Array; + var buttons: Array; +} + +typedef TCatSocket = { + var name: String; + var type: String; +} + +typedef TCatButton = { + var name: String; + var type: String; + var default_value: Dynamic; + var data: Array; +} + +@:access(arm.UINodes) +class NodeCreatorLogic { + + public static var list:TNodeList; + + static function nodeColor(type:String):Int { + switch(type) { + case 'Logic': + return 0xffb34f5a; + case 'Event': + return 0xffb34f5a; + case 'Action': + return 0xffb34f5a; + case 'Value': + return 0xffb34f5a; + case 'Variable': + return 0xffb34f5a; + case 'Input': + return 0xffb34f5a; + case 'Animation': + return 0xffb34f5a; + case 'Physics': + return 0xffb34f5a; + case 'Sound': + return 0xffb34f5a; + case 'Navmesh': + return 0xffb34f5a; + case 'Native': + return 0xffb34f5a; + } + return 0xffb34f5a; + } + + static function socketColor(type:String):Int { + switch(type) { + case 'ACTION': + return 0xffcc4c4c; + case 'OBJECT': + return 0xff268cbf; + // case 'ARRAY': + // case 'ANIMACTION': + case 'SHADER': + return 0xff4982a0; + case 'INTEGER': + return 0xff63c763; + case 'VALUE': + return 0xff63c763; + case 'VECTOR': + return 0xff63c763; + case 'RGBA': + return 0xff63c763; + case 'STRING': + return 0xffffffff; + case 'BOOL': + return 0xff63c763; + } + return 0xffb34f5a; + } + + static function socketDefault(type:String):Dynamic { + switch(type) { + case 'ACTION': + return 0; + case 'OBJECT': + return 0; + // case 'ARRAY': + // case 'ANIMACTION': + case 'SHADER': + return 0; + case 'INTEGER': + return 0; + case 'VALUE': + return 0.0; + case 'VECTOR': + return [0.0, 0.0, 0.0]; + case 'RGBA': + return [0.0, 0.0, 0.0, 0.0]; + case 'STRING': + return ''; + case 'BOOL': + return false; + } + return 0; + } + + public static function draw(cat:Int) { + var ui = UINodes.inst.ui; + var getNodeX = UINodes.inst.getNodeX; + var getNodeY = UINodes.inst.getNodeY; + var nodes = UINodes.inst.nodes; + var canvas = UINodes.inst.canvasLogic; + + var c:TCat = list.categories[cat]; + for (cnode in c.nodes) { + if (ui.button(cnode.name)) { + var node_id = nodes.getNodeId(canvas.nodes); + var n:TNode = { + id: node_id, + name: cnode.name, + type: cnode.type, + x: getNodeX(), + y: getNodeY(), + color: nodeColor(cnode.type), + inputs: [], + outputs: [], + buttons: [] + }; + for (cinp in cnode.inputs) { + var soc:TNodeSocket = { + id: nodes.getSocketId(canvas.nodes), + node_id: node_id, + name: cinp.name, + type: cinp.type, + color: socketColor(cinp.type), + default_value: socketDefault(cinp.type) + }; + n.inputs.push(soc); + } + for (cout in cnode.outputs) { + var soc:TNodeSocket = { + id: nodes.getSocketId(canvas.nodes), + node_id: node_id, + name: cout.name, + type: cout.type, + color: socketColor(cout.type), + default_value: socketDefault(cout.type) + }; + n.outputs.push(soc); + } + for (cbut in cnode.buttons) { + var but:TNodeButton = { + name: cbut.name, + type: cbut.type, + output: 0, + default_value: cbut.default_value, + data: cbut.data + }; + n.buttons.push(but); + } + canvas.nodes.push(n); + nodes.nodeDrag = n; + nodes.nodeSelected = n; + } + } + } +} diff --git a/Sources/arm/UINodes.hx b/Sources/arm/UINodes.hx index 3240d4ce..ea63b929 100644 --- a/Sources/arm/UINodes.hx +++ b/Sources/arm/UINodes.hx @@ -37,7 +37,12 @@ class UINodes extends iron.Trait { public var canvasBrush:TNodeCanvas = null; var canvasBrushMap:Map = null; var canvasBrushBlob:String; - public var isBrush = false; + + public var canvasLogic:TNodeCanvas = null; + var canvasLogicMap:Map = null; + var canvasLogicBlob:String; + + public var canvasType = 0; // material, brush, logic public function new() { super(); @@ -47,22 +52,30 @@ class UINodes extends iron.Trait { iron.data.Data.getBlob('default_material.json', function(b1:kha.Blob) { iron.data.Data.getBlob('default_brush.json', function(b2:kha.Blob) { + iron.data.Data.getBlob('default_logic.json', function(b3:kha.Blob) { + iron.data.Data.getBlob('logic_nodes.json', function(bnodes:kha.Blob) { - canvasBlob = b1.toString(); - canvasBrushBlob = b2.toString(); - canvas = haxe.Json.parse(canvasBlob); - canvasBrush = haxe.Json.parse(canvasBrushBlob); - parseBrush(); + canvasBlob = b1.toString(); + canvasBrushBlob = b2.toString(); + canvas = haxe.Json.parse(canvasBlob); + canvasBrush = haxe.Json.parse(canvasBrushBlob); + parseBrush(); + canvasLogicBlob = b3.toString(); + canvasLogic = haxe.Json.parse(canvasLogicBlob); - var t = Reflect.copy(arm.App.theme); - t.ELEMENT_H = 18; - t.BUTTON_H = 16; - var scale = armory.data.Config.raw.window_scale; - ui = new Zui({font: arm.App.font, theme: t, color_wheel: arm.App.color_wheel, scaleFactor: scale}); - ui.scrollEnabled = false; - - notifyOnRender2D(render2D); - notifyOnUpdate(update); + NodeCreatorLogic.list = haxe.Json.parse(bnodes.toString()); + + var t = Reflect.copy(arm.App.theme); + t.ELEMENT_H = 18; + t.BUTTON_H = 16; + var scale = armory.data.Config.raw.window_scale; + ui = new Zui({font: arm.App.font, theme: t, color_wheel: arm.App.color_wheel, scaleFactor: scale}); + ui.scrollEnabled = false; + + notifyOnRender2D(render2D); + notifyOnUpdate(update); + }); + }); }); }); } @@ -78,7 +91,7 @@ class UINodes extends iron.Trait { } else canvas = c; - if (!isBrush) nodes = UITrait.inst.selectedMaterial.nodes; + if (canvasType == 0) nodes = UITrait.inst.selectedMaterial.nodes; } } @@ -93,10 +106,31 @@ class UINodes extends iron.Trait { } else canvasBrush = c; - if (isBrush) nodes = UITrait.inst.selectedBrush.nodes; + if (canvasType == 1) nodes = UITrait.inst.selectedBrush.nodes; } } + public function updateCanvasLogicMap() { + if (UITrait.inst.selectedLogic != null) { + if (canvasLogicMap == null) canvasLogicMap = new Map(); + var c = canvasLogicMap.get(UITrait.inst.selectedLogic); + if (c == null) { + c = haxe.Json.parse(canvasLogicBlob); + canvasLogicMap.set(UITrait.inst.selectedLogic, c); + canvasLogic = c; + } + else canvasLogic = c; + + if (canvasType == 2) nodes = UITrait.inst.selectedLogic.nodes; + } + } + + function getCanvas() { + if (canvasType == 0) return canvas; + else if (canvasType == 1) return canvasBrush; + else return canvasLogic; + } + var mx = 0.0; var my = 0.0; var mdown = false; @@ -106,6 +140,7 @@ class UINodes extends iron.Trait { function update() { updateCanvasMap(); updateCanvasBrushMap(); + updateCanvasLogicMap(); var mouse = iron.system.Input.getMouse(); mreleased = mouse.released(); @@ -114,11 +149,12 @@ class UINodes extends iron.Trait { if (ui.changed) { mchanged = true; if (!mdown) changed = true; - if (isBrush) parseBrush(); + if (canvasType == 1) parseBrush(); + else if (canvasType == 2) parseLogic(); } if ((mreleased && mchanged) || changed) { mchanged = changed = false; - if (!isBrush) parsePaintMaterial(); + if (canvasType == 0) parsePaintMaterial(); UITrait.inst.makeMaterialPreview(); if (UITrait.inst.brushPaint == 2) UITrait.inst.makeStickerPreview(); } @@ -145,13 +181,13 @@ class UINodes extends iron.Trait { } if (keyboard.started("x") || keyboard.started("backspace")) { - var c = isBrush ? canvasBrush : canvas; + var c = getCanvas(); nodes.removeNode(nodes.nodeSelected, c); changed = true; } // if (keyboard.started("p")) { - // var c = isBrush ? canvasBrush : canvas; + // var c = getCanvas(); // var str = haxe.Json.stringify(c); // trace(str.substr(0, 1023)); // trace(str.substr(1023, 2047)); @@ -218,14 +254,14 @@ class UINodes extends iron.Trait { ui.g.font = arm.App.font; ui.g.fontSize = 22; - var title = isBrush ? "Brush" : "Material"; + var title = canvasType == 1 ? "Brush" : "Material"; var titlew = ui.g.font.width(22, title); var titleh = ui.g.font.height(22); ui.g.drawString(title, ww - titlew - 20, iron.App.h() - titleh - 10); // Recompile material on change ui.changed = false; - var c = isBrush ? canvasBrush : canvas; + var c = getCanvas(); nodes.nodeCanvas(ui, c); ui.g.color = ui.t.WINDOW_BG_COL; @@ -236,9 +272,48 @@ class UINodes extends iron.Trait { ui._y = 3; ui._w = 105; - if (isBrush) { + if (canvasType == 1) { if (ui.button("Nodes")) { addNodeButton = true; menuCategory = 0; popupX = wx + ui._x; popupY = wy + ui._y; } } + else if (canvasType == 2) { + if (ui.button("Action")) { addNodeButton = true; menuCategory = 0; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x += 105 + 3; + ui._y = 3; + if (ui.button("Animation")) { addNodeButton = true; menuCategory = 1; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x += 105 + 3; + ui._y = 3; + if (ui.button("Array")) { addNodeButton = true; menuCategory = 2; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x += 105 + 3; + ui._y = 3; + if (ui.button("Canvas")) { addNodeButton = true; menuCategory = 3; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x += 105 + 3; + ui._y = 3; + if (ui.button("Event")) { addNodeButton = true; menuCategory = 4; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x += 105 + 3; + ui._y = 3; + if (ui.button("Input")) { addNodeButton = true; menuCategory = 5; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x = 3; + ui._y = 30; + if (ui.button("Logic")) { addNodeButton = true; menuCategory = 6; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x = 105 + 3; + ui._y = 30; + if (ui.button("Native")) { addNodeButton = true; menuCategory = 7; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x += 105 + 3; + ui._y = 30; + if (ui.button("Navmesh")) { addNodeButton = true; menuCategory = 8; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x += 105 + 3; + ui._y = 30; + if (ui.button("Physics")) { addNodeButton = true; menuCategory = 9; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x += 105 + 3; + ui._y = 30; + if (ui.button("Sound")) { addNodeButton = true; menuCategory = 10; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x += 105 + 3; + ui._y = 30; + if (ui.button("Value")) { addNodeButton = true; menuCategory = 11; popupX = wx + ui._x; popupY = wy + ui._y; } + ui._x += 105 + 3; + ui._y = 30; + if (ui.button("Variable")) { addNodeButton = true; menuCategory = 12; popupX = wx + ui._x; popupY = wy + ui._y; } + } else { if (ui.button("Input")) { addNodeButton = true; menuCategory = 0; popupX = wx + ui._x; popupY = wy + ui._y; } ui._x += 105 + 3; @@ -260,7 +335,10 @@ class UINodes extends iron.Trait { if (drawMenu) { - var numNodes = isBrush ? NodeCreatorBrush.numNodes[menuCategory] : NodeCreator.numNodes[menuCategory]; + var numNodes = 0; + if (canvasType == 0) numNodes = NodeCreator.numNodes[menuCategory]; + else if (canvasType == 1) numNodes = NodeCreatorBrush.numNodes[menuCategory]; + else if (canvasType == 2) numNodes = NodeCreatorLogic.list.categories[menuCategory].nodes.length; var ph = numNodes * 20; var py = popupY; g.color = 0xff222222; @@ -268,7 +346,9 @@ class UINodes extends iron.Trait { ui.beginLayout(g, Std.int(popupX), Std.int(py), 105); - isBrush ? NodeCreatorBrush.draw(menuCategory) : NodeCreator.draw(menuCategory); + if (canvasType == 0) NodeCreator.draw(menuCategory); + else if (canvasType == 1) NodeCreatorBrush.draw(menuCategory); + else if (canvasType == 2) NodeCreatorLogic.draw(menuCategory); ui.endLayout(); } @@ -942,4 +1022,13 @@ class UINodes extends iron.Trait { armory.system.Logic.packageName = "arm.logicnode"; var tree = armory.system.Logic.parse(canvasBrush, false); } + + var lastT:iron.Trait = null; + public function parseLogic() { + if (lastT != null) UITrait.inst.currentObject.removeTrait(lastT); + armory.system.Logic.packageName = "armory.logicnode"; + var t = armory.system.Logic.parse(canvasLogic); + lastT = t; + UITrait.inst.currentObject.addTrait(t); + } } diff --git a/Sources/arm/UITrait.hx b/Sources/arm/UITrait.hx index 6ca67d43..1e4e34e9 100644 --- a/Sources/arm/UITrait.hx +++ b/Sources/arm/UITrait.hx @@ -176,6 +176,7 @@ class UITrait extends iron.Trait { public var selectedMaterial:MaterialSlot; var brushes:Array = null; public var selectedBrush:BrushSlot; + public var selectedLogic:BrushSlot; public var layers:Array = null; public var undoLayers:Array = null; public var selectedLayer:LayerSlot; @@ -469,7 +470,7 @@ class UITrait extends iron.Trait { // var uiWidth = 2048; // var uiHeight = 2048; - var currentObject:MeshObject; + public var currentObject:MeshObject; var frame = 0; function done() { @@ -997,15 +998,22 @@ class UITrait extends iron.Trait { function showMaterialNodes() { UIView2D.inst.show = false; - if (UINodes.inst.show && !UINodes.inst.isBrush) UINodes.inst.show = false; - else { UINodes.inst.show = true; UINodes.inst.isBrush = false; } + if (UINodes.inst.show && UINodes.inst.canvasType == 0) UINodes.inst.show = false; + else { UINodes.inst.show = true; UINodes.inst.canvasType = 0; } arm.App.resize(); } function showBrushNodes() { UIView2D.inst.show = false; - if (UINodes.inst.show && UINodes.inst.isBrush) UINodes.inst.show = false; - else { UINodes.inst.show = true; UINodes.inst.isBrush = true; } + if (UINodes.inst.show && UINodes.inst.canvasType == 1) UINodes.inst.show = false; + else { UINodes.inst.show = true; UINodes.inst.canvasType = 1; } + arm.App.resize(); + } + + function showLogicNodes() { + UIView2D.inst.show = false; + if (UINodes.inst.show && UINodes.inst.canvasType == 2) UINodes.inst.show = false; + else { UINodes.inst.show = true; UINodes.inst.canvasType = 2; } arm.App.resize(); } @@ -1241,6 +1249,8 @@ class UITrait extends iron.Trait { } } + if (ui.button("LNodes")) showLogicNodes(); + ui.unindent(); } } @@ -1760,7 +1770,7 @@ class UITrait extends iron.Trait { showMessage("Error: Invalid mesh - no UVs found"); return; } - makeMesh(obj); + makeMesh(obj, path); }); } @@ -1771,7 +1781,7 @@ class UITrait extends iron.Trait { showMessage("Error: Invalid mesh - no UVs found"); return; } - makeMesh(obj); + makeMesh(obj, path); }); } @@ -1782,7 +1792,7 @@ class UITrait extends iron.Trait { showMessage("Error: Invalid mesh - no UVs found"); return; } - makeMesh(obj); + makeMesh(obj, path); }); } @@ -1793,11 +1803,11 @@ class UITrait extends iron.Trait { // showMessage("Error: Invalid mesh - no UVs found"); // return; // } - // makeMesh(obj); + // makeMesh(obj, path); // }); } - function makeMesh(mesh:Dynamic) { + function makeMesh(mesh:Dynamic, path:String) { var raw:TMeshData = { name: "Mesh", vertex_arrays: [ @@ -1811,21 +1821,46 @@ class UITrait extends iron.Trait { }; new MeshData(raw, function(md:MeshData) { - currentObject.data.delete(); - iron.App.notifyOnRender(initLayers); - if (paintHeight) iron.App.notifyOnRender(initHeightLayer); - currentObject.setData(md); - - // Scale to bounds - md.geom.calculateAABB(); - var r = Math.sqrt(md.geom.aabb.x * md.geom.aabb.x + md.geom.aabb.y * md.geom.aabb.y + md.geom.aabb.z * md.geom.aabb.z); - currentObject.transform.scale.set(3 / r, 3 / r, 3 / r); - currentObject.transform.buildMatrix(); + // Replace + { + currentObject.data.delete(); + iron.App.notifyOnRender(initLayers); + if (paintHeight) iron.App.notifyOnRender(initHeightLayer); + + currentObject.setData(md); + + // Scale to bounds + md.geom.calculateAABB(); + var r = Math.sqrt(md.geom.aabb.x * md.geom.aabb.x + md.geom.aabb.y * md.geom.aabb.y + md.geom.aabb.z * md.geom.aabb.z); + currentObject.transform.scale.set(3 / r, 3 / r, 3 / r); + currentObject.transform.buildMatrix(); + + // Face camera + // currentObject.transform.setRotation(Math.PI / 2, 0, 0); + } + + // Append + { + // var mats = new haxe.ds.Vector(1); + // mats[0] = currentObject.materials[0]; //selectedMaterial.data; + // var object = iron.Scene.active.addMeshObject(md, mats, iron.Scene.active.getChild("Scene")); + // path = StringTools.replace(path, "\\", "/"); + // var ar = path.split("/"); + // var s = ar[ar.length - 1]; + // object.name = s.substring(0, s.length - 4); + + // // md.geom.calculateAABB(); + // // var aabb = md.geom.aabb; + // // var dim = new TFloat32Array(3); + // // dim[0] = aabb.x; + // // dim[1] = aabb.y; + // // dim[2] = aabb.z; + // // object.raw.dimensions = dim; + // object.addTrait(new armory.trait.physics.RigidBody(0.0)); + // selectObject(object); + } - // Face camera - // currentObject.transform.setRotation(Math.PI / 2, 0, 0); - first = 0; // Needs 2 redraws to clear textures after import dirty = true; }); diff --git a/armorpaint.blend b/armorpaint.blend index 5490e33f..3474f75f 100644 Binary files a/armorpaint.blend and b/armorpaint.blend differ