Skip to content

How to configure Fbx import settings? #488

Open

Description

@yuchen-sketch

Hi all,
I am trying to do something with importing heaps of fbx files coming from maya automatically.
I just read some provieded docs and scripts, and followed the Kaiju example.
However, I just found there is no docs talking about how to set other import settings like 'convert scene', 'combine meshes'.
And I also tried

fbx_factory.ImportUI.bConvertScene = True
fbx_factory.ImportUI.bCombineMeshes = True

which seemed not working.

I am just wondering how I can configure other settings while importing fbx files, and where I can get all api things.

Anyone can help me?

Thanks

Activity

  1. rdeioris commented on Jul 30, 2018

    @rdeioris
    Contributor

    Hi, the python api maps 1:1 with the C++ one, so you can get the infos from official docs; https://api.unrealengine.com/INT/API/Editor/UnrealEd/Factories/UFbxImportUI/index.html

    But honestly that docs are not so handy.

    Just print the properties() return value to get the list of related options.

    In your case you would end with fbx_factory.ImportUI.StaticMeshImportData.bConvertScene

  2. yuchen-sketch commented on Jul 31, 2018

    @yuchen-sketch
    Author

    Cool, man.
    Thank you so much.

  3. yuchen-sketch commented on Jul 31, 2018

    @yuchen-sketch
    Author

    Hi, I just tried the StaticMeshImportData.
    The good news was that the bCombineMeshes worked.
    However, the bConvertScene still not working.

    I also tried
    fbx_factory.ImportUI.SkeletalMeshImportData.bConvertScene = True
    and
    fbx_factory.ImportUI.AnimSequenceImportData.bConvertScene = True

    the imported model's coordinator was not converted yet.

    However, if i do it mannually, check or uncheck the 'convert scene' would affect the result.
    Not sure what else I should do for this problem.

  4. rdeioris commented on Jul 31, 2018

    @rdeioris
    Contributor

    You need to choose the right *ImportData object based on what you are importing. If you are importing a skeletal mesh you will use SkeletalMeshImportData and so on.

  5. yuchen-sketch commented on Jul 31, 2018

    @yuchen-sketch
    Author
    from unreal_engine.classes import PyFbxFactory
    from unreal_engine.enums import EFBXImportType
    
    fbx_factory = PyFbxFactory()
    temp_fbx = r"X:\Temp\HRJ\XL\lantern.fbx"
    
    fbx_factory.ImportUI.MeshTypeToImport = EFBXImportType.FBXIT_StaticMesh
    fbx_factory.ImportUI.bCreatePhysicsAsset = False
    fbx_factory.ImportUI.bImportMaterials = False
    fbx_factory.ImportUI.bImportTextures = False
    fbx_factory.ImportUI.bImportAnimations = False
    fbx_factory.ImportUI.StaticMeshImportData.bConvertScene = True
    fbx_factory.ImportUI.StaticMeshImportData.bCombineMeshes = True
    
    # import the mesh
    temp_mesh = fbx_factory.factory_import_object(temp_fbx, `'/Game/Sceneset')``
    

    Here are the codes.
    The bConvertScnee keeps not working.
    Actually the interesting point is the 'convert scene' parameter in the mesh editor is checked, but the coordinator not change.
    Could you pls figure it out if my code has something wrong?
    I am new to unreal, and I am doing a test like automatically import fbx files and textures according to a json file so that I can migrate my scene from maya to unreal

    Thx

  6. rdeioris commented on Jul 31, 2018

    @rdeioris
    Contributor

    Your code is right, but are you sure you do not have z-up already in maya ? 'convert scene' will make a check about the axis data available in the fbx file

  7. yuchen-sketch commented on Jul 31, 2018

    @yuchen-sketch
    Author

    Nope
    I do not think I did the operation.
    The fact is that if I imported the fbx manually and check the 'convert scene'parameter, the result would be good.

    On the other hand, if I imported it by script, whether i set bConvertScene to True or False, the result was just same as I imported it manually and unchecked 'convert scene'

  8. yuchen-sketch commented on Jul 31, 2018

    @yuchen-sketch
    Author

    All right,
    I tested the script with 4.19 and it worked.
    It seems that the issue is a bug with 4.20.1.

  9. rdeioris commented on Jul 31, 2018

    @rdeioris
    Contributor

    I have made a little modification to latest code. Can you try it ?

  10. yuchen-sketch commented on Aug 1, 2018

    @yuchen-sketch
    Author

    Yes, no problem.
    Where can I get the modified code?

  11. rdeioris commented on Aug 1, 2018

    @rdeioris
    Contributor

    Just clone the master branch

  12. yuchen-sketch commented on Aug 2, 2018

    @yuchen-sketch
    Author

    Okay, after I finish the texture part and shader part with my code.

  13. yuchen-sketch commented on Aug 5, 2018

    @yuchen-sketch
    Author

    Hey Bro,
    I just test with the new code in 4.20. The 'convert scene' works now!!

    I got another question: I couldn't find 'set_material_static_switch_parameter' method with material instance. However , I found there was a pull request about it.
    Not sure why your code not including the function. I just added it according to the pull request while compiling. I am just wondering if there are any issues with this function?

  14. yuchen-sketch commented on Aug 5, 2018

    @yuchen-sketch
    Author

    One more question:

    If I created a material instance with
    MaterialInstanceConstantFactoryNew().factory_create_new( '/Game/Content/Materials/ExampleA' )
    The instance actually would be created as '/Game/Content/Materials/ExampleA/ExampleA.ExampleA'.

    How can I create a instance with other name rather than 'ExampleA.ExampleA' (but in the path of '/Game/Content/Materials/ExampleA/')?

  15. rdeioris commented on Aug 10, 2018

    @rdeioris
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions