#pragma once #include "../CommandHistory.h" #include #include #include #include namespace UsdLayerManager { /// Creates a UsdShadeShader prim with the given Sdr shader identifier and /// authors its canvas position as uiPosition custom data (see /// docs/adr — Material Editor node-graph layout is stored as prim /// customData, not scene data, so it never affects composition/renders). class CreateShaderNodeCommand : public ICommand { public: CreateShaderNodeCommand(pxr::UsdStageRefPtr stage, const pxr::SdfPath& path, const std::string& shaderId, const pxr::GfVec2f& uiPosition); void Execute() override; void Undo() override; std::string GetDescription() const override { return m_description; } private: pxr::UsdStageRefPtr m_stage; pxr::SdfPath m_path; std::string m_shaderId; pxr::GfVec2f m_uiPosition; std::string m_description; }; } // namespace UsdLayerManager