Control Rig: Python access to currently focused model / graph

#rb sara.schvartzman
#jira UE-178106
#preflight https://horde.devtools.epicgames.com/job/63f5f9bf500c05a62419bd24

[CL 24358626 by Helge Mathee in ue5-main branch]
This commit is contained in:
Helge Mathee
2023-02-22 06:25:06 -05:00
parent 5458c53168
commit 8ff3703361
3 changed files with 23 additions and 1 deletions
@@ -1982,6 +1982,17 @@ bool UControlRigBlueprint::RemoveModel(FString InName, bool bSetupUndoRedo, bool
return RigVMClient.RemoveModel(InName, bSetupUndoRedo);
}
URigVMGraph* UControlRigBlueprint::GetFocusedModel() const
{
#if WITH_EDITOR
if(OnGetFocusedGraphDelegate.IsBound())
{
return OnGetFocusedGraphDelegate.Execute();
}
#endif
return RigVMClient.GetDefaultModel();
}
URigVMController* UControlRigBlueprint::GetController(const URigVMGraph* InGraph) const
{
return RigVMClient.GetController(InGraph);
@@ -46,6 +46,7 @@ DECLARE_DELEGATE_RetVal_OneParam(bool, FControlRigOnBreakLinksDialogRequestedDel
DECLARE_DELEGATE_RetVal_OneParam(TRigVMTypeIndex, FControlRigOnPinTypeSelectionRequestedDelegate, const TArray<TRigVMTypeIndex>&);
DECLARE_EVENT(UControlRigBlueprint, FOnBreakpointAdded);
DECLARE_EVENT_OneParam(UControlRigBlueprint, FOnRequestInspectObject, const TArray<UObject*>& );
DECLARE_DELEGATE_RetVal(URigVMGraph*, FControlRigBlueprintGetFocusedGraph);
USTRUCT(meta = (Deprecated = "5.2"))
struct CONTROLRIGDEVELOPER_API FControlRigPublicFunctionArg
@@ -279,6 +280,8 @@ public:
#endif // #if WITH_EDITOR
FControlRigBlueprintGetFocusedGraph& OnGetFocusedGraph() { return OnGetFocusedGraphDelegate; }
virtual bool ShouldBeMarkedDirtyUponTransaction() const override { return false; }
/** IInterface_PreviewMeshProvider interface */
@@ -335,6 +338,9 @@ public:
UFUNCTION(BlueprintCallable, Category = "Control Rig Blueprint")
bool RemoveModel(FString InName = TEXT("Rig Graph"), bool bSetupUndoRedo = true, bool bPrintPythonCommand = true);
UFUNCTION(BlueprintCallable, Category = "Control Rig Blueprint")
URigVMGraph* GetFocusedModel() const;
UFUNCTION(BlueprintCallable, Category = "Control Rig Blueprint")
URigVMController* GetController(const URigVMGraph* InGraph = nullptr) const;
@@ -747,7 +753,8 @@ private:
TArray<URigVMNode*> RigVMBreakpointNodes;
FOnRequestInspectObject OnRequestInspectObjectEvent;
FControlRigBlueprintGetFocusedGraph OnGetFocusedGraphDelegate;
public:
/** Sets the execution mode. In Release mode the rig will ignore all breakpoints. */