Announcement

Collapse
No announcement yet.

Import animation without mesh in Unreal 4.22 using python

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

    Import animation without mesh in Unreal 4.22 using python

    Hello !
    I do a script for import a animation in unreal engine but the parameter FbxImportUI.import_mesh does not work :/ When I run the script it import the animation and the mesh but I want import only the animation, the mesh already exists in another folder.

    This is my code :

    ```
    import os.path
    import unreal

    # Option
    taskoptions = unreal.FbxImportUI()
    taskoptions.set_editor_property('Skeleton', unreal.find_asset(r'/Game/Temp/SK_Armature_Skeleton.SK_Armature_Skeleton'))
    taskoptions.set_editor_property('import_materials', False)
    taskoptions.set_editor_property('import_textures', False)
    taskoptions.set_editor_property('import_animations', True)
    taskoptions.set_editor_property('import_mesh', False)
    taskoptions.set_editor_property('create_physics_asset',False)
    taskoptions.set_editor_property('original_import_type', unreal.FBXImportType.FBXIT_ANIMATION)
    taskoptions.skeletal_mesh_import_data.set_editor_property('import_morph_targets', True)

    # Task
    task = unreal.AssetImportTask()
    task.filename = r'D:\MyAnim\ArmatureAction.fbx'
    task.destination_path = r'/Game/Temp/Anim'
    task.automated = True
    task.save = True
    task.replace_existing = True
    task.set_editor_property('options', taskoptions)

    unreal.AssetToolsHelpers.get_asset_tools().import_asset_tasks([task,])
    ```

    I did something wrong? Thank you for your reply !
    Last edited by Loux xavier; 06-10-2019, 08:04 AM.

    #2
    In unreal you cannot import an animation without a mesh it seems.
    I tried many times before.
    You cant even import a multi take/animation fbx

    Comment


      #3
      You can do it if the skeleton already exists it was enough to select the skeleton and uncheck import mesh. (Like in the picture)
      I do the same manipulation with python but it does not work :/

      Comment


        #4
        Originally posted by Loux xavier View Post
        You can do it if the skeleton already exists it was enough to select the skeleton and uncheck import mesh. (Like in the picture)
        I do the same manipulation with python but it does not work :/
        You could check if you get the same result with the unofficial Python plugin: https://github.com/20tab/UnrealEnginePython (example of importing animations in /Tutorials/YourFirstAutomatedPipeline.md)

        If that works fine submit a bug report for the UE4 python plugin.

        Comment

        Working...
        X