Timeline for Import and export in one python script for FBX to IFC in Blender
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 26, 2021 at 10:38 | answer | added | Dion Moult | timeline score: 1 | |
Sep 8, 2020 at 23:26 | comment | added | JBH | CMD Loop was the answer! | |
Sep 8, 2020 at 10:35 | comment | added | JBH | Ok, i'll look into that | |
Sep 8, 2020 at 10:18 | comment | added | scurest |
You can look up how to loop over files in a .bat on SO. You would pass the file to blender by adding -- path\to\file.fbx to the cmdline args, and in the .py script you'd get it with sys.argv[sys.argv.index("--")+1] .
|
|
Sep 8, 2020 at 10:11 | comment | added | JBH | Nope that didn't work. I'm not sure i was clear enough before. The script exports the 'test1' file twice, test1.ifc and test2.ifc are identical when opened. | |
Sep 8, 2020 at 10:02 | comment | added | JBH | I’ll give that a go. however i’m curious to know how to do the loop in the bat file, how might that work? | |
Sep 8, 2020 at 9:14 | comment | added | scurest |
Try bpy.ops.object.select_all(action='SELECT') ; bpy.ops.object.delete(use_global=False) to clear the scene. But it might be better to do the loop in the .bat file and pass just one file to be converted to the .py script at a time.
|
|
Sep 8, 2020 at 9:08 | comment | added | JBH | what happens is that the same geometry is in all the exported .ifc files. i thought if i added bpy.ops.scene.new(type='EMPTY') after the file export in the same For loop it would clear the scene and move onto the next fbx file this didn't work. | |
Sep 8, 2020 at 8:23 | comment | added | scurest | Not sure I understand, but each export will have all the previous FBXs included in the scene. Did you want to clear the scene at the beginning of the loop? | |
Sep 8, 2020 at 8:18 | review | First posts | |||
Sep 8, 2020 at 9:53 | |||||
Sep 8, 2020 at 8:14 | history | asked | JBH | CC BY-SA 4.0 |