Announcement

Collapse
No announcement yet.

Legality of attempting to spawn Datasmith Actor at runtime.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Legality of attempting to spawn Datasmith Actor at runtime.

    I've managed to finally spawn a Datasmith Actor at runtime using modules from Engine/Source/Developer (DatasmithContent, DatasmithCore and DatasmithImporter).

    However, it seems as though we are not under the licence allowed to use this content outside of editor.

    My question is, if one wants to leverage the udatasmith file to spawn in assets at runtime, can we do so legally currently by any means?
    For example, if I make my own XML parser to parse out the info in a udatamsith file, would that be allowed?

    EDIT: To be clear, spawning in isn't just the Datasmith Actor but all of the other StaticMesh Actors as well, basically what dragging and dropping a DS scene in editor does but at runtime.

    Ideally I would like to make use of the ImportContext to aid in spawning at runtime.
    Last edited by Nonlin; 03-11-2020, 10:57 AM.

    #2
    Nonlin How did you manage to do that? I am also looking to import models through datasmith at runtime using C++.

    Comment


      #3
      Originally posted by AK-NCT View Post
      Nonlin How did you manage to do that? I am also looking to import models through datasmith at runtime using C++.
      Currently you are not allowed/able to do that but by 4.26 it may be possible according to a comment from the developers.
      I was able to do it at runtime but using Editor Only headers that you can't package with.
      So a bit pointless to use if you can't package it.

      Comment


        #4
        Did you try it in v4.24?
        In v4.25 Datasmith code is moved to runtime (https://docs.unrealengine.com/en-US/...ore/index.html) as seen in installation directory -- UE_4.25\Engine\Source\Runtime\Datasmith\DatasmithCore

        Comment


          #5
          Originally posted by AK-NCT View Post
          Did you try it in v4.24?
          In v4.25 Datasmith code is moved to runtime (https://docs.unrealengine.com/en-US/...ore/index.html) as seen in installation directory -- UE_4.25\Engine\Source\Runtime\Datasmith\DatasmithCore
          Yes I originally tried in 4.24 and I'm aware that in 4.25 they gave us more access but I didn't try to see if that was sufficient. Based on my 4.24 experience I don't think that alone is enough and last Epic developer forum post mentioned they are planning to allow this in 4.26 so I've sort of left it to 4.26 for the time being.

          Comment


            #6
            @ Nonlin Could you import solidworks or cartia format files at runtime with your methord? tks!

            Comment


              #7
              Originally posted by hamkoo View Post
              @ Nonlin Could you import solidworks or cartia format files at runtime with your methord? tks!
              Unreal Datasmith supports importing Solidworks natively https://www.unrealengine.com/en-US/d...validated=true

              But to be clear, this is importing into the World/Scene via the Editor. Currently you can't spawn in anything at runtime and expect to be able to package the game to share it.

              Comment


                #8
                I am trying to customize the Datasmith import process in Editor only using my own C++ plugin.
                To do that did following steps :
                1. Added "DatasmithImporter" in private dependencies of plugin
                2. Included required headers i.e. "DatasmithImporterModule.h" & "DatasmithBlueprintLibrary.h"
                3. And added below code

                IDatasmithImporterModule& iDatasmithImporterModule = FModuleManager::GetModuleChecked< IDatasmithImporterModule >(TEXT("DatasmithImporter"));
                bool IsAvailable = iDatasmithImporterModule.IsAvailable();

                UDatasmithSceneElement::ConstructDatasmithSceneFromFile("D:\\_micro engine.CATProduct");

                But still get error at compile time. Refer the image

                Click image for larger version

Name:	error.PNG
Views:	54
Size:	32.9 KB
ID:	1807472

                Can someone tell what is wrong?

                Comment


                  #9
                  Originally posted by Chetan.Mahajan View Post
                  I am trying to customize the Datasmith import process in Editor only using my own C++ plugin.
                  To do that did following steps :
                  1. Added "DatasmithImporter" in private dependencies of plugin
                  2. Included required headers i.e. "DatasmithImporterModule.h" & "DatasmithBlueprintLibrary.h"
                  3. And added below code

                  IDatasmithImporterModule& iDatasmithImporterModule = FModuleManager::GetModuleChecked< IDatasmithImporterModule >(TEXT("DatasmithImporter"));
                  bool IsAvailable = iDatasmithImporterModule.IsAvailable();

                  UDatasmithSceneElement::ConstructDatasmithSceneFromFile("D:\\_micro engine.CATProduct");

                  But still get error at compile time. Refer the image

                  {"data-align":"none","data-size":"full","title":"error.PNG","data-attachmentid":1807472}

                  Can someone tell what is wrong?
                  See my original post here, when I was trying to do something similar I had to include the modules (DatasmithContent, DatasmithCore and DatasmithImporter) but that was in 4.23.

                  For example IDataSmithScene used in that method you are trying to call is inside DatasmithCore.
                  Last edited by Nonlin; 09-02-2020, 10:59 AM.

                  Comment


                    #10
                    Originally posted by Nonlin View Post

                    See my original post here, when I was trying to do something similar I had to include the modules (DatasmithContent, DatasmithCore and DatasmithImporter) but that was in 4.23.

                    For example IDataSmithScene used in that method you are trying to call is inside DatasmithCore.
                    Thank you for the reply!
                    I am adding the dependencies you added. Refer image But still getting same linking error. I am using Unreal Engine 4.25
                    Click image for larger version  Name:	dependencies.PNG Views:	0 Size:	31.9 KB ID:	1807528

                    Comment

                    Working...
                    X