public void LoadEditor(BfresBone bone)
 {
     ImGui.BeginTabBar("bone_tab");
     if (ImguiCustomWidgets.BeginTab("bone_tab", "Bone Data"))
     {
         LoadBoneTab(bone);
         ImGui.EndTabItem();
     }
     if (ImguiCustomWidgets.BeginTab("bone_tab", "User Data"))
     {
         UserDataInfoEditor.Render(bone.BoneData.UserData);
         ImGui.EndTabItem();
     }
     ImGui.EndTabBar();
 }
Esempio n. 2
0
        public void LoadEditorMenus(FMAT material)
        {
            if (UVViewport == null)
            {
                Init();
            }

            if (activeMaterial != material)
            {
                onLoad = true;
                MaterialParameter.Reset();
                MaterialOptions.Reset();
                BfresTextureMapEditor.Reset();
                UVViewport.Reset();
            }

            activeMaterial = material;

            if (ImGui.CollapsingHeader("Material Info", ImGuiTreeNodeFlags.DefaultOpen))
            {
                ImGuiHelper.InputFromText("Name", material, "Name", 200);
                ImGuiHelper.InputFromText("ShaderArchive", material, "ShaderArchive", 200);
                ImGuiHelper.InputFromText("ShaderModel", material, "ShaderModel", 200);
                ImGuiHelper.InputFromBoolean("Visible", material.Material, "Visible");
            }

            if (ImGui.BeginChild("##MATERIAL_EDITOR"))
            {
                ImGui.BeginTabBar("Menu1");

                if (ImguiCustomWidgets.BeginTab("Menu1", "Texture Maps"))
                {
                    BfresTextureMapEditor.Render(material, UVViewport, onLoad);
                    ImGui.EndTabItem();
                }

                if (ImguiCustomWidgets.BeginTab("Menu1", "Parameters"))
                {
                    MaterialParameter.Render(material);
                    ImGui.EndTabItem();
                }
                if (ImguiCustomWidgets.BeginTab("Menu1", "Render Info"))
                {
                    RenderInfoEditor.Render(material);
                    ImGui.EndTabItem();
                }
                if (ImguiCustomWidgets.BeginTab("Menu1", "Options"))
                {
                    MaterialOptions.Render(material);
                    ImGui.EndTabItem();
                }

                if (!material.ParentFile.ResFile.IsPlatformSwitch)
                {
                    if (ImguiCustomWidgets.BeginTab("Menu1", "Render State"))
                    {
                        RenderStateEditor.Render(material);
                        ImGui.EndTabItem();
                    }
                }

                if (ImguiCustomWidgets.BeginTab("Menu1", "User Data"))
                {
                    UserDataInfoEditor.Render(material.Material.UserData);
                    ImGui.EndTabItem();
                }

                if (material.MaterialAsset is BfshaRenderer)
                {
                    if (ImguiCustomWidgets.BeginTab("Menu1", "Shader Data"))
                    {
                        BfshaShaderProgramViewer.Render(material);
                        ImGui.EndTabItem();
                    }
                }
                else if (material.MaterialAsset is SharcFBRenderer)
                {
                    if (ImguiCustomWidgets.BeginTab("Menu1", "Shader Data"))
                    {
                        SharcFBShaderProgramViewer.Render(material);
                        ImGui.EndTabItem();
                    }
                }


                if (material.MaterialAsset is KSANXRender)
                {
                    if (ImguiCustomWidgets.BeginTab("Menu1", "Lighting Data"))
                    {
                        ((KSANXRender)material.MaterialAsset).RenderUI();
                        ImGui.EndTabItem();
                    }
                }

                ImGui.EndTabBar();
            }
            ImGui.EndChild();

            onLoad = false;
        }