Creating Custom Convertors / Blueprint Nodes

Hello,

I’m trying to create a kind of mapping between Grasshoper and UE5.

I’ve created a blueprint class for overriding the meshes but I have some missing nodes between some “Cast to Mesh” and “Create Transform”. How can I create a proper variable type to connect them or is there any other way to achieve this?

Also, for “Convert to Native” node I can’t create the proper input node for “Target” and “Available Convertors”.

Could you please help me about these?

Thanks a lot in advance!


1 Like

Hi @Humeyra_Cam

I hope you don’t mind, I’ve just posted my original BP for other speckle users here: Grasshopper to Unreal - asset swap / mapping meshes from Grasshopper proof of concept
which also provides some context to your above screenshots for anyone else.

I assume you’re trying to extend/re-create the same structure in your BP_OverrideMesh.


In response to your question, for your Convert to Native call (your first screenshot), you’ll want to pass in the AvaiableConverter that is provided to you as an input in the ConvertToNative
image

You can either drag a long line from this pin to your Convert to native node. Or simply reference it like other variables like so (they are functionally identical)

Then for the Target, we want to target a mesh converter. I set this up by exposing a FallbackConverter variable, and assigning it with the DefaultStaticMeshConverter, on the instance of


For some explanation as to what this part is doing, for Meshes that are not mapped, we still want to convert them. And to do that we need to use an “actual” mesh converter (e.g. the DefaultStaticMeshConverter or DefaultProceduralMeshConverter)

And the AvaiableConverters is a reference to the Objects Converter setup on the ASpeckleUnrealManager. This is used by some converters to call other converters, e.g. the render material converter is used by the static mesh converter.
We simply need to pass the value through to any Convert To Native calls.


For your second screenshot, I presume you are wanting to do this (Get Transform) to reference the “transform” property on your incoming meshes. But note, this “transform” property needs to be sent along with the geometry from grasshopper, as it’s not populated by default when sending from any connector.

2 Likes

Hi @Jedd

Thanks a lot for your detail explanation!

I’ve achieved to create a node for Target but to me when I am creating a new variable as “Fallback Convertor” and set it as a Speckle Convertor Component it doesn’t connect with the Target. Therefore, I created Available Convertors again and in the details I set the it’s variable type as Speckle Convertor Component as you can see in the below image: ( I hope it’s also fine with it but I am not sure)

And I think for this reason I can’t see the “DefaultStaticMeshConvertor” under the Speckle Types in “OverrideMeshConvertor”.

Also, I can’t edit Fallback Convertor:

Afterwards, when I want to assign the Convertor to the Conversion in my SpeckleUnrealManager, everything seems like okay but when I started to play the game nothing is changing. I can’t see the my BP_Tree asset instead of speckle objects that I want to convert.

I am sharing my whole file’s screenshots with you.

1 Like

Instead of Speckle Converter Component (this is an Unreal component that stores Speckle Converters
You want Speckle Converter

If this option doesn’t appear for you, then you can always drag out the target, and promote to variable

If you pass in the AvaiableConverters into the target, you risk an infinite circular loop where your override mesh BP will be used instead of the “actual” static/procedural mesh converter


Once you have that setup, and either DefaultStaticMeshConverter or ProceduralMeshConverter assigned as your fallback converter.

Then you can add OverrideMeshConverter into the list of active converters on the SpeckleUnrealManager actor’s Speckle Converter Component.

Make sure it’s higher in the list than any other mesh converters. Otherwise it won’t be used.

Additionally, from your grasshopper screenshot, I don’t see you attaching the transforms to your geometry.

Unfortunately this is required, as the meshes that grasshopper send don’t contain any position/rotation/scale information.

This is one of the significant limitations to this mapping approach.

Potentially you could work around this, by attaching (and then receiving in UE) the x, y, z position (only), or calculating the bounding boxes of the meshes, or through some other means? but if you’re wanting to recreate my example, then you must keep track of and attach your GH transformations.

1 Like

Thanks again!

For “Fallback Convertor” I cant see the Speckle Convertor under the Interface category because there is no Interface category in the Variable Type.

Also when I drag out the target there is no “promote to variable” options for this.

I also checked the Class Setting again but I guess everything is okay here:

Hmm, not sure why, but it’s not appearing for me now. Potentially a UE5.0 vs 5.2 difference. :thinking:

I’ve just added a flag to the SpeckleConverter interface to ensure it is exposed as a type BPs can use.
and it now works correctly on 5.2.

If you follow the instructions to install the connector through git you should be able to fetch this change now. It will take a while before this change will reach marketplace.

1 Like

Hi @Jedd,

Thanks again! I’ve just checked the SpeckleConvertor header file, yes it’s updated right not but I still can’t see the Speckle Convetor under Interface even though I created new blueprint class.

I’m using UE5.1.1, do you think should I also install other versions of UE5?

1 Like

We fully support UE 4.7, 5.0-5.2 so you shouldn’t be any need to change versions.

Please can you uninstall or disable the marketplace version of the connector to ensure no conflicts.
And then try re-building your project directly from your IDE. (Visual Studio or Rider)

Hi Jedd,

I’ve reinstalled the speckle connector to the engine and rebuilt my project from visual studio as you said, but I still have the same problem. I can’t see the Speckle Interface folder.

For anyone else who has any similar issues in future.

We managed to resolve the issue by re-generating visual studio project and performing a re-build of the project via Visual Studio.
This needs to be done every time you pull a new update/branch via git.

Additionally, adding the missing flag to the interface header ensures that SpeckleConverter is available as a type in all blueprint contexts. This change will be included in future releases of the Unreal connector (and available now from main branch on github)

4 Likes