Different results in seemingly similar function C++/BP

Hi, I need to get the job names of a MovieRenderQueue. Prototyping in Blueprint worked perfectly fine but the seemingly C++ gives me a different (undesired) output.

Here’s the Blueprint implementation of working BP only and the C++ library function: blueprintue.com

Here’s the function:

.h:

UFUNCTION(BlueprintCallable, Category = DeadlineInterface)
static bool CreateTempJobQueues(UMoviePipelineQueue* Queue);


.cpp:

bool UDeadlineInterfaceBPLibrary::CreateTempJobQueues(UMoviePipelineQueue* Queue)
{
	const TArray<UMoviePipelineExecutorJob*> Jobs = Queue->GetJobs();
	for (UMoviePipelineExecutorJob* Job : Jobs)
	{
		FString JobName = Job->GetName();
		UE_LOG(LogDeadlineInterfaceDebug, Verbose, TEXT("%s"), *JobName); //DEBUG
	}
	return true;
}

The output of the C++ is:
LogDeadlineInterfaceDebug: Verbose: MoviePipelineExecutorJob_4
LogDeadlineInterfaceDebug: Verbose: MoviePipelineExecutorJob_5
LogDeadlineInterfaceDebug: Verbose: MoviePipelineExecutorJob_0

And from BP:
LogBlueprintUserMessages: [Deadline_Interface_C_0] Sequence_01
LogBlueprintUserMessages: [Deadline_Interface_C_0] Sequence_02
LogBlueprintUserMessages: [Deadline_Interface_C_0] Sequence_03

The Blueprint output matches the names set and displayed in the Movie Render Queue interface, which is what I want,

Can anyone point me to what I’m obviously donig wrong in my c++?

Hi @00Napfkuchen !

I’m not familiar with the UMoviePipelineExecutorJob class, but from what I saw on your code, you are using GetName(), that returns the name of the instance of a class you are asking, normally it is something like:

AWhatever* Something;
Something->GetName();

Assuming that Something is already instanciated, the GetName() should return Whatever_0.
It always returns the (name of the class)_(index of instance), so if there are 10 Whatever instanced and you ask the GetName of the 10th, it should return Whatever_9 (it starts at 0)

With that in mind, maybe there is another function that does what you need.

Hope this helps, Kind regards
Raimundo

3 Likes

Change:

FString JobName = Job->GetName();

To:

FString JobName = Job->JobName;
3 Likes

Thanks to both of you. I should really get used to looking up C++ class implementations before trynig to translate BP 1:1 :thinking:

Using the Puplic UPROPERTY as @SolidSk suggested obviously works.