# Different results in seemingly similar function C++/BP

**URL:** <https://forums.unrealengine.com/t/different-results-in-seemingly-similar-function-c-bp/611282>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 21, 2022, 10:12pm UTC](https://forums.unrealengine.com/t/different-results-in-seemingly-similar-function-c-bp/611282 "2022-07-21T22:12:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![00Napfkuchen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@00Napfkuchen](https://forums.unrealengine.com/u/00Napfkuchen)\
**Post date:** [July 21, 2022, 10:12pm UTC](https://forums.unrealengine.com/t/different-results-in-seemingly-similar-function-c-bp/611282/1 "2022-07-21T22:12:32Z")

</div>

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](https://blueprintue.com/blueprint/kuxw2p24/)

Here’s the function:

```auto
.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++?

---

<div class="post-metadata">

**Author:** ![barracius-AOne](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/barracius-aone/32/548049_2.png) [@barracius-AOne](https://forums.unrealengine.com/u/barracius-AOne)\
**Post date:** [July 21, 2022, 10:44pm UTC](https://forums.unrealengine.com/t/different-results-in-seemingly-similar-function-c-bp/611282/2 "2022-07-21T22:44:26Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

**Author:** ![SolidSk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/solidsk/32/1194513_2.png) [@SolidSk](https://forums.unrealengine.com/u/SolidSk)\
**Post date:** [July 21, 2022, 10:45pm UTC](https://forums.unrealengine.com/t/different-results-in-seemingly-similar-function-c-bp/611282/3 "2022-07-21T22:45:13Z")

</div>

Change:

```auto
FString JobName = Job->GetName();

```

To:

```auto
FString JobName = Job->JobName;

```

---

<div class="post-metadata">

**Author:** ![00Napfkuchen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@00Napfkuchen](https://forums.unrealengine.com/u/00Napfkuchen)\
**Post date:** [July 21, 2022, 10:59pm UTC](https://forums.unrealengine.com/t/different-results-in-seemingly-similar-function-c-bp/611282/4 "2022-07-21T22:59:02Z")

</div>

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

Using the Puplic UPROPERTY as @SolidSk suggested obviously works.
