Implemented Animation Clip asset and animation controller #410
|
@ -305,7 +305,10 @@ namespace SHADE
|
|||
ImGui::BeginDisabled(ImNodes::NumSelectedNodes() != 1);
|
||||
if (ImGui::Button(std::format("{} Set Starting Node", ICON_MD_HOME).data()))
|
||||
{
|
||||
|
||||
// Get id of selected node
|
||||
int selectedNode = 0;
|
||||
ImNodes::GetSelectedNodes(&selectedNode);
|
||||
controllerData->StartingNode = selectedNode; // We can do this as the ImNodes node index is the same
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
@ -325,6 +328,15 @@ namespace SHADE
|
|||
// Title
|
||||
ImNodes::BeginNodeTitleBar();
|
||||
{
|
||||
// Starting node marker
|
||||
if (node.Index == controllerData->StartingNode)
|
||||
{
|
||||
const float INDENT = NODE_WIDTH * 0.6f;
|
||||
ImGui::Indent(INDENT);
|
||||
ImGui::Text(ICON_MD_HOME);
|
||||
ImGui::Unindent(INDENT);
|
||||
}
|
||||
|
||||
if (node.EditingName)
|
||||
{
|
||||
if (ImGui::Button(ICON_MD_DONE))
|
||||
|
@ -749,6 +761,12 @@ namespace SHADE
|
|||
}
|
||||
}
|
||||
|
||||
// Mark starting node
|
||||
if (nodeMap.contains(controller.GetStartingNode()))
|
||||
{
|
||||
data.StartingNode = nodeMap[controller.GetStartingNode()]->Index;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
SHAnimationController SHAnimationControllerEditor::serialise(const AnimControllerData& data)
|
||||
|
|
|
@ -100,7 +100,7 @@ namespace SHADE
|
|||
|
||||
struct AnimControllerData
|
||||
{
|
||||
|
||||
NodeIndex StartingNode = 0;
|
||||
std::list<Node> Nodes;
|
||||
std::unordered_map<std::string, SHAnimationController::AnimParam::Type> Params;
|
||||
LinkMap Links;
|
||||
|
|
Loading…
Reference in New Issue