You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
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
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
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'
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?
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/')?
Activity
rdeioris commentedon Jul 30, 2018
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
yuchen-sketch commentedon Jul 31, 2018
Cool, man.
Thank you so much.
yuchen-sketch commentedon Jul 31, 2018
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.
rdeioris commentedon Jul 31, 2018
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.
yuchen-sketch commentedon Jul 31, 2018
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
rdeioris commentedon Jul 31, 2018
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
yuchen-sketch commentedon Jul 31, 2018
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'
yuchen-sketch commentedon Jul 31, 2018
All right,
I tested the script with 4.19 and it worked.
It seems that the issue is a bug with 4.20.1.
rdeioris commentedon Jul 31, 2018
I have made a little modification to latest code. Can you try it ?
yuchen-sketch commentedon Aug 1, 2018
Yes, no problem.
Where can I get the modified code?
rdeioris commentedon Aug 1, 2018
Just clone the master branch
yuchen-sketch commentedon Aug 2, 2018
Okay, after I finish the texture part and shader part with my code.
yuchen-sketch commentedon Aug 5, 2018
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?
yuchen-sketch commentedon Aug 5, 2018
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/')?
rdeioris commentedon Aug 10, 2018
Hi, you can use asset renaming: https://github.com/20tab/UnrealEnginePython/blob/master/docs/ManagingAssets.md#movingrenaming-assets
fixed autodetection for PyFbxFactory #488