Hello,
I have an issue / possible bug report regarding the Movie Render Graph (MRG). I have been trying to create a node via C++ class which inherits from UMovieGraphFileOutputNode and the ultimate goal is to export a flattened camera cut camera in USD (.usda) along with the render.
The virtual functions overrides I am trying to implement this in are:
OnReceiveImageDataImpl(…) - implementing the collection of data per frame, getting metadata and shot data
OnAllFramesFinalizedImpl(…) - implementing the file output
For this, I created multiple variables and those are stored in a class. However, on render, the Movie Pipeline completely omits the evaluated MRG values and uses the default values specified in the C++ class. I have tried this by changing the values, creating a variable and putting it in an exposed property pin and also changing the variables from the Primary Graph Variables. On manual MRG evaluation, the branch gets correct values, but on render execution, the methods work with default values defined in the C++ class.
Can you tell me if this is the actual correct behavior or a bug? I can imagine that the config is being copied into a static version of it, but I did not expect the UProperty variables to not have any effect on defined functions while being changed in the config. It’s probably not the best place to export USD cameras, but I have ideas for exporting via nodes and resolving this issue would be helpful.
Steps to Reproduce
Steps to recreate:
- Create a new C++ class inheriting from UMovieGraphFileOutputNode (or UMovieGraphSettingNode).
- Create a new public variable with an override bool, e.g. Directory.
- In UE Movie Render Graph, change the value of Directory or expose it as a pin and assign a variable to it.
- In OnAllFramesFinalizedImpl, log the value of Directory (as of now it will remain the same as is defined by default in cpp, but that’s not the expected behavior).
- Render local
UCLASS(meta = (DisplayName = "USDCameraExport")) class UMovieGraphCameraUSDOutputNode : public UMovieGraphFileOutputNode { GENERATED_BODY() public: UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Overrides, meta = (InlineEditConditionToggle)) bool bOverride_Directory = true; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "File Output", meta = (EditCondition = "bOverride_Directory")) FString Directory = TEXT("{project_dir}Saved/MovieRenders/"); protected: virtual void OnReceiveImageDataImpl(UMovieGraphPipeline* InPipeline, UE::MovieGraph::FMovieGraphOutputMergerFrame* InRawFrameData, const TSet<FMovieGraphRenderDataIdentifier>& InMask) override; virtual void OnAllFramesSubmittedImpl(UMovieGraphPipeline* InPipeline, TObjectPtr<UMovieGraphEvaluatedConfig>& InPrimaryJobEvaluatedGraph) override; virtual void OnAllFramesFinalizedImpl(UMovieGraphPipeline* InPipeline, TObjectPtr<UMovieGraphEvaluatedConfig>& InPrimaryJobEvaluatedGraph) override; }
Hello Mr. Williams,
Firstly, thank you for your very quick reply, that is much appreciated. Secondly, the info you sent me worked wonders and your explanation was super understandable. I expected something like this to be the case and this completely solved my issue (and those in the future).
I found it a little unfortunate that this info/data is hidden this way, I was already giving up haha.
Have a great one!
Petr