EpicGamesExt / BlenderTools

Blender addons that improve the game development workflow between Blender and Unreal.
https://epicgamesext.github.io/BlenderTools/
MIT License
2.79k stars 58 forks source link

Send to Unreal - Place asset in active level #522

Closed cantcodetho closed 1 year ago

cantcodetho commented 1 year ago

Use object origin is supposed to move objects back in their places, but it does not do that in 5.03, Blender 3.3.1. Since the plugin does not work with U4 at all for me can't tell what is the cause. Anyway someone might prefer that objects stay in the center after importing, but then it should be marked as 3rd seperate option.

james-baber commented 1 year ago

We haven't tested on blender 3.3.1 yet. Can you reproduce the issue with just the default Cube with use object origin on and still get the error? Also when it fails can you toggle on the system console and copy and paste the output here? Thanks!

cantcodetho commented 1 year ago

Well I need two cubes to be able visually to see if it moves or not from the center when I drag both into the scene. And yes it happens with default two cubes. Objects move and stay in the center unless I don't get something basic.

Blender Console did not show anything interesting. I attached that scene with two cubes. Both have their origins at the center mass. Maybe I am stupid and am doing something wrong, but considering first half works (moving to the center) and second one does not I doubt it. I saw it was not working in the past in bug reports. By the way is UE4 support abandoned?

Read prefs: C:\Users\super\AppData\Roaming\Blender Foundation\Blender\3.3\config\userpref.blend register_class(...): Warning: 'EasyBakeUIPanel' does not contain 'PT' with prefix and suffix ez_baker updater verbose is enabled ez_baker Updater: Read in JSON settings from file registering <class 'rigify.feature_sets.GameRig_main.gamerig_generate.GAMERIG_OT_generate'> Reloading external rigs... Reloading external metarigs... register_class(...): Warning: 'ARMATURE_MT_Game Animals_class' doesn't have an alpha-numeric suffix register_class(...): Warning: 'ARMATURE_MT_Game Basic_class' doesn't have an alpha-numeric suffix Auto Reload --- Checking for Addon New Version Auto Reload --- Addon up to date Auto Reload --- All files modification time updated Warning: property 'need_active' not found in item 'FILE_OT_execute' Warning: TypeError('bpy_struct: item.attr = val: enum "OVERRIDE_LIBRARY_RESYNC_HIERARCHY_ENFORCE" not found in (\'UNLINK\', \'LOCAL\', \'SINGLE\', \'DELETE\', \'REMAP\', \'COPY\', \'PASTE\', \'ADD_FAKE\', \'CLEAR_FAKE\', \'RENAME\', \'SELECT_LINKED\')') Read blend: C:\Users\super\Documents\cube_test.blend Auto Reload --- Checking for Addon New Version Auto Reload --- Addon up to date Auto Reload --- All files modification time updated

FBX export starting... 'C:\Users\super\AppData\Local\Temp\blender\send2ue\data\mesh\Cube.fbx' export finished in 0.0000 sec.

FBX export starting... 'C:\Users\super\AppData\Local\Temp\blender\send2ue\data\mesh\Cube_001.fbx' export finished in 0.0000 sec. cube_test.zip

james-baber commented 1 year ago

So I just tried your file on blender 3.3.1 and it is working fine for me. This is what my output looks like image

Looks to me like you might have some other addons installed. I dont know what "EasyBake" is or "Game Animals", etc. So I would disable all non-default blender addons besides send2ue. Then shutdown blender, restart and re-try.

cantcodetho commented 1 year ago

Am I doing something wrong? Am I misunderstanding something here? Fresh Blender 3.01, only this addon. I check the "use object origin" option. I send to unreal. I select all the meshes in content drawer. I drag and drop them into the viewport and they end up with their origins at 0.0.0 rather than the exact position as they were in Blender. Is there altenative to drag and drop, some place actor option or something I am missing?

iigindesign commented 1 year ago

Hi @cantcodetho, use object origin exports objects centered in their own origin rather than the original blender world origin. If you would like the object to continue using the world origin, this extension should be turned off. What is your expected behavior of your file?

cantcodetho commented 1 year ago

I want exactly what use object origin claims to do in the description. It claims to move object during export to world origin AND put them back after import to their original location. So lets say I have entire scene build house, well barn etc, I expect that option to pretty much copy and paste it from blender as it is modeled. It does NOT do that. It moves objects to the world origin but does NOT put them back to their original locations in the world. So everything is more or less just slammed in the center of the world on top of each other which is not what you expect from description. The move to world origin half of the description works, but the move back to their original place half of the description does not seem to work.

In short, I expect origin per object AND correct object position in the scene exactly as it is in blender with that option. Basically copy and paste of entire scene from blender as it is.

james-baber commented 1 year ago

The description is misleading, it describes how the extension works (by moving the object to world center then back to where it originally was in blender). It might be better if it didn't describe this process, since its probably just confusing.

What you are looking for does not currently exist. However there is a post_import callback for extensions, if you want to write the logic that transfers the blender world offsets to the actors in the active unreal level. Alternatively, the USD workflow for at least static meshes and cameras might be an option too.

cantcodetho commented 1 year ago

I see, so basically it just moves it for some internal reasons during export but does not export real world location in the file.

Anyway never mind. I just realized entire import area in Unreal is absolutely atrocious especially for engine of this caliber. The USD (at least from Blender) either does not keep scale or location, things are not where they should be. I checked it after someone mentioned it is broken in some comment and yup, they were right. Actually virtual production > USD stage imported things correctly. Actually USD crashes on reimport with few changes.

The "import into level" blueprint on reimport triggers "reimport" window for each object, nothing like pressing 1000 times reimport button every time I save main FBX file.

How about autoimport of many FBX files from folder in project? Say hello to 7 year old "import all" not working bug. You get pop up per file. You cannot even hold enter, have to spam it. Officialy bug marked as "cannot reproduce" even though people rage in the forums that it absolutely exists. I confirm, it exists even in 5.03.

The best I found is Asset Creation Toolset plugin that mass export all objects into seperate FBX files. That way objects have correct position in the world. Now they all unfortunatelly have pivots centered in the 0.0.0 world position. Let me right click them in UE5 and move pivots to the base or center of mass, oh wait... such options do not exist.

Can you see how absurd the situation is in the engine of this magnitude? If you are connected to Epic ( I assume you are) please make sure someone there actually realizes how bad things are. Some people want to export more than 1 rock.

Thank you.

james-baber commented 1 year ago

Ill try to address your comments at least related to this addon. The "import all" prompt should not pop up if the Launch FBX Import UI is off. Which is the default. And you can batch import more than one asset at a time.

This addon is scoped to moving the supported asset types listed in the docs to the unreal content browser. If you want to build levels with it there is a post_import callback for extensions. But currently this is something you have to define. Which placing the asset into the active level would be just a few unreal python calls.

Ill re-open this also as a feature request as well as the need to update the description of "use object origin". We can look into adding an extension with an option like "place asset in active level".

james-baber commented 1 year ago

Duplicate of https://github.com/EpicGames/BlenderTools/issues/522

Please follow that for more info

REMvisual commented 1 year ago

this issue still hasnt been resolved.. ticking use world orgin does not save the correct "postion" when adding items to the viewport...

REMvisual commented 1 year ago

any news on this issue?