UE5 C++ 3 - How To Import Assets with C++? - Unreal Engine Tutorial Editor CPP

Поділитися
Вставка
  • Опубліковано 1 лют 2025

КОМЕНТАРІ • 19

  • @guyonlead
    @guyonlead 10 місяців тому +2

    Hi Alex, firstly thank you for the video tutorials on the cpp side. It has helped me progress through my editor projects that I will use for modding games.

    • @guyonlead
      @guyonlead 10 місяців тому +1

      I've edited my comment as I've figured out that I was casting an AActor into an AStaticMeshActor and that was causing my access violation. My code is now working after 3 days of struggling. lol.

  • @jbbird3548
    @jbbird3548 2 роки тому +1

    that was fast 😨. Thanks man :D
    I'll be tittering with this when I finish the mammoth of your main series

  • @FLATLINEGameDevChannel
    @FLATLINEGameDevChannel Рік тому

    Man you're the life saver

  • @abdullahal-aboud6335
    @abdullahal-aboud6335 2 місяці тому

    thanks Alex , but the assetTools not works in game for package game like shipping or development (error in UnreaEd)

  • @devon9374
    @devon9374 3 місяці тому

    Great video.
    Whats the difference b/w doing in C++ as opposed to the Python API?

  • @marcapouli7805
    @marcapouli7805 6 місяців тому

    Je suppose que ça ne marche pas pour migrer des classes c++ d'un autre projet, en tous cas c'est tellement compliqué je pense que ça sera plus rapide de réécrire mon c++.
    Sinon il y a déjà un bouton "importer" dans unreal, quel est l'intérêt de passer par le c++?

  • @johnharding419
    @johnharding419 10 місяців тому

    Hi Alex,
    Many thanks for the excellent video.
    I've copied your example - but when I do the import it's keeping the same base name as the file being imported. In your demo you always used that name. Can you confirm if you can save the asset with a different name.
    e.g. If I importAsset("banana.jpg", "/Game/Tests/orange") I get Content/Tests/banana.uasset (and I would expect to get Content/Tests/orange.uasset)
    Any ideas?

  • @ViraPayesh2024
    @ViraPayesh2024 9 місяців тому

    so I want to use this for importing assets from my website into the player pc real-time. is that possible?

  • @absolutator9828
    @absolutator9828 Рік тому

    Great video! I wanted to clarify whether such imports in build are possible? Let's say after assembly of the project to download and use the external fbx file? Or mp4 for video? Or change the clothes to the character from the external file?

    • @AlexQuevillonEn
      @AlexQuevillonEn  Рік тому

      It is possible, but not using that technique.
      This is really made to update the assets in the content of your project, but, in a packaged application, those assets aren't really editable.
      I never did it myself so I can't really give you the code you need, but I'll dig into it in the future for sure.
      You'll probably want to go deeper in the ImportAssetTasks function and see what it does to process an FBX file. Then try to hook yourself to that code. The FBX should be processed the same way, but not saved into a uasset like I'm doing in editor.
      Oh and for the MP4, you just have to update the Path in the FileMediaSource before you call OpenSource, that one is even doable in blueprint :P
      And yep, you'll probably need to process all the different asset types you want to support one by one as the import process is probably different.

    • @absolutator9828
      @absolutator9828 Рік тому

      @@AlexQuevillonEn Thanks! Great tutorials!)

  • @jordanellapin5655
    @jordanellapin5655 Рік тому

    Great video as always!
    Just 2 questions about the pathes you use.
    1) {project_dir} where does in point to? I guess it should be the UE5 project folder but since it's not imported yet I don't get it lol
    2) How in your path "/Game" becomes "Content" when you import your assets? There is no folder named "Game" in your project after all...
    Update1 : I tried {project_dir} but dit not work so I logged it and it works something in chinese loool can't find any information about this if you can explain please
    Update2 : The destination path does not consider the last part so when you write "3_MyTexture" it does not use it to name the asset imported, at least that how it did for me with the same code. It takes the name of the source file only. I just write "/Game/Tests/" and every asset will go in this folder. I think it's ok since you usually don't want to rename asset during import (at least for 3D pipelines).
    Also why importing Json files by drag and drop works but not with this code please?
    Thank you!

    • @wywarren
      @wywarren 11 місяців тому

      /Game/ internally is referred to as an Asset Path. It maps directly to your Content Browser's main Content folder. If you have content plugins, in Content browser it will show under Plugins > Plugin Name Content, but that content folder is actually using asset path /PluginName/. With asset paths you never need to include the "Content" in there. It's weird and one of the things not well explained anywhere. There are path functions in C++ and python that can help you convert between an absolute path, an asset path and a project relative path.

  • @NBPCFOREVER
    @NBPCFOREVER Рік тому

    Salut Alex, super vidéo c'était exactement ce que je cherchais ! Je débute tout juste le développement en C++ et je voulais savoir s'il y avait moyen de sauvegarder automatiquement les textures générées lors d'un import FBX, ca ne m'a pas l'air très simple. Je vais aller faire un tour sur ta chaine FR donc si tu as des vidéos à me conseiller pour m'aider à apprendre le développement sur Unreal ce sera avec plaisir que j'irai les regarder :D

    • @AlexQuevillonEn
      @AlexQuevillonEn  Рік тому

      Allo allo! Si tu mets l'option bSave à true, ça ne fonctionne pas? (3:51)
      Si c'est vraiment le cas, faudrait probablement sauvegarder manuellement tous les assets qui ont été importés.
      Tu peux avoir la liste de ces assets en utilisant le GetObjects() sur le ImportTask après l'import. (5:54)
      Et tu devrais pouvoir les sauvegarder avec UEditorLoadingAndSavingUtils::SavePackages(PackagesToSave, true)
      docs.unrealengine.com/5.1/en-US/API/Editor/UnrealEd/UEditorLoadingAndSavingUtils/SavePackages/
      Mais sinon, si tu veux tous sauvegarder, tu peux simplement utiliser FEditorFileUtils::SaveDirtyPackages(false, true, true)
      docs.unrealengine.com/4.27/en-US/API/Editor/UnrealEd/FEditorFileUtils/SaveDirtyPackages/

    • @NBPCFOREVER
      @NBPCFOREVER Рік тому

      @@AlexQuevillonEn Eh non, malheureusement bSave ne sauvegarde que les mesh et pas les textures générées. Merci infiniment pour les infos, ca devrait m'aider ! Y a tellement de modules, ca donne le tournis !

    • @AlexQuevillonEn
      @AlexQuevillonEn  Рік тому

      @@NBPCFOREVER Yep, yep. Ça prend du temps à apprendre tout ça :P
      Et intéressant de savoir que ça ne marche que sur les meshes. Je vais garder ça en tête