Unable to change file path

Hello,

I’m using Dataprep to import an FBX file, and running into some difficulties of arranging my data.

I have the following on import:

[Image Removed]

I’ll discuss textures here, but in reality I need this for all parts of the imported resources.

Here, I have Terrain_4x7 texture in the folder Terrain_4x7_fbx\Textures

I want it to be in the folder Terrain_4x7\TestTextures

If I use the Output to Folder operation, I can only do one folder level at a time. It does not take / or \ so only one folder level can be specified. If I stack two of these operations, with a single folder level name in it…it just takes one of the folders…latest I believe. So instead of the texture being in Terrain_4x7\TestTextures, it actually comes out of the top level folder and now gets dumped into just \TestTextures\

[Image Removed]

I tried to make a custom operation…

And what I found out, is that I can change the file name of the texture, I can access and print out the current temp path of the texture, but I see no way to actually specify or change the path of the texture by a blueprint.

[Image Removed]

How would I go about telling Dataprep to place my texture or other resource into specific folder path? More precisely a folder structure like Folder1\Folder2\MyTextures and not just MyTextures

V/R,

--Maxim

[mention removed]​ You commented on a similar problem here:

https://forums.unrealengine.com/t/change-name-of-asset-in-dataprep/245064

I was wondering if you had some ideas with my problem… in this case…I need to change the path, not the name.

[mention removed]​ You helped before with data prep issues, I wonder if you know anything about this.

Hi Maxim,

Unfortunately, I do not know anything about this. I will have to investigate. In the mean time, I created a ticket so you can track the resolution of your issue: UE-273984. The link may take some days to become operational.

Thanks for your patience.

Regards,

Jean-Luc

Hi Maxim,

I copied the wrong URL. Sorry about that.

Here is the correct one: UE-273984 It is still not operational but it should become operational soon.

Let me know if you still cannot access within a couple of days.

Thanks.

Regards,

Jean-Luc

[mention removed]​

I can get to the link now. Do you know if this is a bug, something I just did not find, or a missing feature that will need to be implemented?

Hi Maxim,

I had a quick look at the code and this definitely looks like a bug. Unfortunately, I currently do not have time to look any deeper into it.

I’ll let you know as soon as I found the root cause and a fix.

Thanks for your patience.

Regards,

Jean-Luc

P.S. Do not hesitate to ping me back if you do not hear from me.

Hi Maxim,

I did have a deeper look into this issue. I found a fix to allow users to specify a relative path instead of a single folder name.

The fix will not go in the coming release. It is too late for that. Sorry.

However, you can make a local modification if you want.

Below is the fixed code to replace the FDataprepSetOutputFolderDetails::FolderName_TextChanged method in [UE_INSTALL_DIR]Engine\Plugins\Enterprise\DataprepEditor\Source\DataprepLibraries\Private\DataprepOperations.cpp starting line 462:

`void FDataprepSetOutputFolderDetails::FolderName_TextChanged(const FText& Text)
{
// Slash and Square brackets are invalid characters for a folder name
const FString InvalidChars = INVALID_OBJECTPATH_CHARACTERS TEXT(“.”);

FText ErrorMessage;
FString FolderPath = Text.ToString();

if (FolderPath.Len() == 0)
{
ErrorMessage = LOCTEXT(“InvalidFolderName_PathEmpty”, “A folder path must be at least one character long”);
}
else if (FolderPath.StartsWith(TEXT(“/”)))
{
ErrorMessage = LOCTEXT(“InvalidFolderName_MustBeRelative”, “A folder path must be relative”);
}
else
{
// See if the name contains invalid characters.
FString Char;
for (int32 CharIdx = 0; CharIdx < FolderPath.Len(); ++CharIdx)
{
Char = FolderPath.Mid(CharIdx, 1);

if (InvalidChars.Contains(*Char))
{
FString ReadableInvalidChars = InvalidChars;
ReadableInvalidChars.ReplaceInline(TEXT(“\r”), TEXT(“”));
ReadableInvalidChars.ReplaceInline(TEXT(“\n”), TEXT(“”));
ReadableInvalidChars.ReplaceInline(TEXT(“\t”), TEXT(“”));

ErrorMessage = FText::Format(LOCTEXT(“InvalidFolderName_InvalidCharacters”, “A folder path may not contain any of the following characters: {0}”), FText::FromString(ReadableInvalidChars));
break;
}
}

}

if (!ErrorMessage.IsEmpty() || !FFileHelper::IsFilenameValidForSaving(FolderPath, ErrorMessage))
{
TextBox->SetError(ErrorMessage);
}
else
{
// Clear error
TextBox->SetError(FText::GetEmpty());
}

bValidFolderName = ErrorMessage.IsEmpty();
}`I hope it helps.

Regards,

Jean-Luc

Hi [mention removed]​

I’m testing it now… will report if it worked.

I did notice that if you place \ instead of / in the path, that the folder name does get broken. If you sat Test\Texture, you will get a folder Test\Texture in the folder called Test. Test>Test\Texture

Don’t know what’s better…to list \ as an illegal character, or make a translation from one to the other.

Also…

I can access the texture setting node in the main DataPrep:

[Image Removed]But is there a blueprint version of the same node, so I can access it from a custom dataprep operation? None of the ones I attempted to use worked so far:

[Image Removed]

Hi Maxim,

Here is the BP node to use to apply the sub-folder to the assets part of the Dataprep context:

/SetSubOutputFolder​

Regards,

Jean-Luc

Hi [mention removed]​

It seems your message got cut out…

[Image Removed]

Hi Maxim,

It looks like I do not have the right to share a linked image :unamused_face:

I have uploaded the image and a zip of it in the attachments section of this report. Let me know if you can access it,

Regards,

Jean-Luc

Hm… I don’t see any attachments at all from here.

[mention removed]​ Funny enough though, I went through my emails and it seems when you made the original disappearing link, it did send me the name of the BP. It just hid it here.

[Image Removed]I actually had it in some of my tests before, but I had it hooked up to a package for object instead of the original object. It works now though!

Hi Maxim,

Good to read that you were able to get the image and move forward.

Regards,

Jean-Luc

[mention removed]​ Is this link authenticated with my normal epic account, or do I need to have another access granted for this?