Download

Spawn Datasmith actor ?

Bonjour,
In our project, we import some Datasmith Object.
We want to spawn them in the level with blueprint.

It seems, we must use Datasmith specific node but don’t understand how.
With the node Spawnactor, we can indicate “Datasmith Scene Actor” as class.
But how to tell wich datasmith asset associate to this new actor ?
I haven’t success to access to his component “Datasmith”.
Thanks,
Philippe

Bonjour ,

I think i have a solution for you but you would need to try an experimental feature .
If you are in the middle of a production , i would recommend you don’t try this.
If you’re not, here’s what i would do:

  • First you would need to go in the editor preference
  • Search for Utility (this will ask you to restart the editor )

  • Right click in your content browser folder
  • Go to Editor Utilities–> Blutility

  • In Class section , select ActorActionUtility

  • Once New editor created , right click on your BluePrint to open it

edit.png

  • Once BP open, Click on add function.
  • Rename you function–> create datasmith actor
  • From your function , drag and connect to:
  • Search for Spawn Actor from object and Add your Datasmith Scene in dropdown menu.

  • Compile and save, close
  • Back to content dble click on your NewEditorUtilityBlueprint

bouton.png

  • By clicking on the create Datasmith Actor bouton this will spawn a Datasmith actor in your scene

Thanks for the answer.
I can now create Datasmith scene actor from your blueprint :slight_smile:

Now, can I call the function from another blueprint ?

I don’t success to do this :frowning:
Philippe

Hi Philippe,

May I ask you for a bit of information on what is the objective of spawning the datasmith actor.
Is it to automate some manual workload in the editor or is it to be able to spawn an actor that contains the result of a datasmith during a play session?

My suggestion will vary a lot depending on your answer to that.

It’s your second proposition :

We have a building (Import Revit with Datasmith)
We have many doors (special ones) coming from max with Datasmith
(FBX is not adapt in our case)

(first) Objective : replace doors in building with the good one from our assets
We need to make it automaticaly on launch of the project because, we have a database of doors who can change

Have you looked here: https://docs.unrealengine.com/en-us/Studio/Datasmith/Overview/CustomizingImportProcess
It may be possible to filter the objects you’re pulling in via Datasmith to filter out the doors in question and replace them with your pre-built door assets via this process using the same transform date as the original ones.

Alright thank you Philippe,

My suggestion defers a bit from the one David suggested, but his suggestion is also valid.

The datasmith scene actor isn’t the way to go currently. It’s mostly used as an internal mechanism for datasmith. During a reimport, this actor is used by datasmith to found which actors are related to the scene. The code that creates the actors under the datasmith scene actor is currently very bound to the editor and this is why it’s not currently exposed to the blueprints.

That being said, there are many ways to work around that and achieve your objective. Such as this one.

You could use the blueprint system to create some “prefabs” assets out of your datasmith imports.


And once you have your collection, you can spawn those “prefabs” in a normal blueprint.

I hope this can help you,
Julien.