Solaris to Unreal Engine - Material Assignment

   6793   10   7
User Avatar
Member
1 posts
Joined: May 2018
Offline
Hi,

I'm trying the Houdini Solaris to UE4 USD workflow and it works pretty well so far.
Models and textures are showing and everything is in the right place. Very promising. Even point clouds are working.
I would like to apply existing unreal materials to specific meshes when opening or reloading the stage.
Houdini Digital Assets can do this with the unreal_material parameter where you assign the reference path of the material.

Looking through the source code of UnrealUSDWrapper there might be already a function in there:

// load each material at the material path;
UsdPrim MaterialPrim = Stage->Load(Path);

if(MaterialPrim)
{
// Default to using the prim path name as the path for this material in Unreal
FString MaterialName = ANSI_TO_TCHAR( MaterialPrim.GetName().GetString().c_str() ) ;

std::string UsdMaterialName;

// See if the material has an “unrealAssetPath” attribute. This should be the full name of the material
static const TfToken AssetPathToken = TfToken(UnrealIdentifiers::AssetPath);
UsdAttribute UnrealAssetPathAttr = MaterialPrim.GetAttribute(AssetPathToken);
if (UnrealAssetPathAttr && UnrealAssetPathAttr.HasValue())
{
UnrealAssetPathAttr.Get(&UsdMaterialName);


}

MaterialNames.Add( MoveTemp( MaterialName ) );
}

What kind of attribute and where do I need to create in Houdini Solaris to make this work in Unreal's USD Stage, if possible?

Thank you!

Steffen
User Avatar
Staff
1448 posts
Joined: July 2005
Offline
From the comment there, it looks like you need to create “unrealAssetPath” attribute of ‘asset’ type on the USD material primitive. You should be able to use Properties LOP do do that.
User Avatar
Member
113 posts
Joined: July 2005
Offline
Hi Steffen -
I'm very impressed you've got this far with the Houdini/UE4 Pipeline.
Is there a documentation you are following?
I'm relatively new to USD and have gone through the SideFX LOP tutorials.
However, I've seem to have hit a brick wall when trying to import into UE4.
I can't seem to get anything I export to import into the UE4 asset browser or get loaded into the USD Stage Actor.
I am able to get the “Original” USD assets to appear in the USD Stage Actor but that would be about it.
Any sort of direction for a USD NEWB is appreciated!
User Avatar
Member
52 posts
Joined:
Offline
Would be lovely to get some light on this workflow too as I too haven't seen much documentation about Solaris -> to Unreal workflows.

Could you share some pointers?

Thanks in advance !
User Avatar
Member
174 posts
Joined: March 2014
Offline
rafal
Solaris -> to Unreal
Hi,
I'm testing that but with “unrealAssetPath + (copy reference in Unreal)” propery on the material UE4.25 doesn't pick the material…
More than that, every Material applied in the editor don't survive after a close/open of UE…
Unusable !
User Avatar
Member
255 posts
Joined: Sept. 2012
Offline
Hey guys

Actually i think like you we are a bunch to be relatively new to Solaris, Unreal and USD.
I will be really interested to see a masterclass with an Houdini sample scene about how to create and manage a full environment, in USD with Solaris, which will be completely DCC agnostic. You could use the same USD scene to work in Houdini, edit in Blender or Maya export the scene in Unreal and finish there. Even Substance support USD to what i know, (havent tried myself )


Any input on this wide but important subject will be welcomed

________________________________________________________________
Vincent Thomas   (VFX and Art since 1998)
Senior Env artist & Lighting & MattePainter & Creative Concepts
 http://fr.linkedin.com/in/vincentthomas [fr.linkedin.com]
Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts
http://fr.linkedin.com/in/vincentthomas [fr.linkedin.com]
User Avatar
Member
16 posts
Joined: June 2018
Online
NNois
rafal
Solaris -> to Unreal
Hi,
I'm testing that but with "unrealAssetPath + (copy reference in Unreal)" propery on the material UE4.25 doesn't pick the material...
More than that, every Material applied in the editor don't survive after a close/open of UE...
Unusable !

Hey,
Did you find a solution not to loose material assignments after opening new USD in Unreal?

Thanks
User Avatar
Member
45 posts
Joined: Jan. 2016
Online
I’m also looking for an answer to this question, did anyone ever figure out how to setup proper material assignments when going from Houdini to Unreal?
User Avatar
Member
20 posts
Joined: Oct. 2013
Offline
Hi
quite an old thread, anyway I found out:
to assign an existing Unreal Material to a primitive via USD one would need this attribute:
custom string unrealMaterial = "/Game/Materials/Glas.Glas" (for example).
You can choose between this override and the preview USD Material within the stage editor


I have no idea how to assign any other unreal attribute, like e.g. "overridden lightmap Resolution". If somebody has an idea (?)
Edited by raschberg - Jan. 22, 2023 08:38:58

Attachments:
chooseContext.jpg (633.7 KB)
screenshot_USDMaterial.jpg (1.0 MB)

User Avatar
Member
24 posts
Joined: July 2018
Online
Curious if anyone got this working. I've got everything setup on the Houdini side but still can't get Unreal to recognize and use the Custom 'unrealMaterial' attribute and assign the shader in engine.
User Avatar
Member
24 posts
Joined: July 2018
Online
Nevermind,got it working. Hip file...
Image Not Found

Attachments:
USD_ToUnreal_wMaterials.hiplc (206.9 KB)

  • Quick Links