Connection Grasshopper and blueprint in Unreal Engine 5

Hello everyone,
I’m trying to connect grasshopper and blueprint to sent data and model in realtime.

My goal is to be able to change data in blueprint and send it to grasshopper and have grasshopper return model data in real time.
I finished the connection of grasshopper and UE5 and it works fine.

I have checked the official tutorial and tried to build a c++ class, but since it is my first time to use UE, BP and c++ inside the UE, I am not very familiar with many steps.

I created a c++ class and compiled it according to the official teaching, but there was a problem that the Ubase class could not be read during compilation, and I did not see the Ubase option when building the class. The following is my error report:


Running C:\Program Files\Epic Games\UE_5.0\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.exe -Target=“MyProject4Editor Win64 Development -Project=”“C:/Users/SLZ_D15/Documents/Unreal Projects/MyProject4/MyProject4.uproject”“” -LiveCoding -LiveCodingModules=“C:/Program Files/Epic Games/UE_5.0/Engine/Intermediate/LiveCodingModules.txt” -LiveCodingManifest=“C:/Program Files/Epic Games/UE_5.0/Engine/Intermediate/LiveCoding.json” -WaitMutex -LiveCodingLimit=100
Log file: C:\Users\SLZ_D15\AppData\Local\UnrealBuildTool\Log.txt
Invalidating makefile for MyProject4Editor (working set of source files changed)
Parsing headers for MyProject4Editor
Running UnrealHeaderTool “C:\Users\SLZ_D15\Documents\Unreal Projects\MyProject4\MyProject4.uproject” “C:\Users\SLZ_D15\Documents\Unreal Projects\MyProject4\Intermediate\Build\Win64\MyProject4Editor\Development\MyProject4Editor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -abslog=“C:\Users\SLZ_D15\AppData\Local\UnrealBuildTool\Log_UHT.txt” -installed
C:/Users/SLZ_D15/Documents/Unreal Projects/MyProject4/Source/MyProject4/MyTestBP.h(9): Error: Couldn’t find parent type for ‘View3D’ named ‘UBase’ in current module (Package: /Script/MyProject4) or any other module parsed so far.
Build failed.

Thanks a lot for help in advance!

Hi @_LIN_YUANSHENG_N7607,

What does your MyTestBP.h look like? Please can share the complete file, maybe I can help spot any errors.

Also, are you using any live coding/hot-reload features of UE? these are often quite temperamental with changes to header files, have you tried closing the editor and performing a rebuild from Visual Studio?

Thank you for your reply!

This is my MyTestBP.h file, I edited it in visual studio
Since I don’t know much about C++, I copied the code directly from the tutorial. Maybe I made some basic mistakes.
Thanks in advance!!

I think I see a couple of minor problems.

  1. with C++, you’ll need to make sure you include the parent class (in this case UBase)
    so adding #include "Objects/Base.h before the ...generated.h import (but after the #pragma once)
  2. In this case, the class definition (lines 1-32) should be kept in the headder (.h) file.
    The implementation of UView3D::Parse should be moved to a seperate .cpp file.

For example, this is what your header file should look like and this is what your cpp file should look like . Traditionally, you’d place these in seperate public and pirvate folders.

Apologies, I realise the tutorial is missing some of these details. I’ll update the tutorial soon to include them.


If you look at your original error message. The build tool doesn’t understand what a UBase is, because it’s not imported.
In general, any class name you use within a header file should be forwards declared, or imported directly (inherited classes must be included).

1 Like

I tried to modify the code, but it seemed that the library could not be correctly recognized during the modification process, The code and error output is as follows:

error C1083: Cannot open include file: ‘Objects/Base.h’: No such file or directory
Build failed.


I am not sure if this required enabling speckle in the project first, so I tried it both with and without it, but the following error appeared when it was disabled:

Error: Couldn’t find parent type for ‘View3DTest’ named ‘UBase’ in current module (Package: /Script/TestBP3) or any other module parsed so far.
Build failed.


I know this is supposed to be an entry-level question, thank you again for your patience in answering it!

Apologies, the include should be #include "SpeckleUnreal/Public/Objects/Base.h"

Your IDE should suggest the paths for you.
inlcude