When Armory is activated I can't import and export fbx files in blender

If I uninstall Armory importing and exporting is normal. Why? How to fix it?
(Blender 2.90 + Armory latest version)

Traceback (most recent call last):
File “C:\Blender 2.90\2.90\scripts\addons\io_scene_fbx_init_.py”, line 208, in execute
from . import import_fbx
File “C:\Blender 2.90\2.90\scripts\addons\io_scene_fbx\import_fbx.py”, line 40, in
from . import parse_fbx, fbx_utils
File “C:\Blender 2.90\2.90\scripts\addons\io_scene_fbx\parse_fbx.py”, line 35, in
from . import data_types
File “C:\Blender 2.90\2.90\scripts\addons\io_scene_fbx\data_types.py”, line 53, in
size = array.array(_t).itemsize
AttributeError: module ‘array’ has no attribute ‘array’

location: :-1

Hi, the error message doesn’t look Armory related per se, but maybe it somehow messes with the Python modules. However, Armory is made for Blender 2.83 LTS versions in order to have more stability, so there is no guarantee that it will work with 2.9.

Thanks. I switch to 2.83 LTS and the problem is still there.

Why this appears when Armory is actvated

Ok I think I know what the problem is, but it will take a bit to fix it. Basically the way that nodes are registered needs to be changed.

If you are interested in the details:

Logic nodes are packed into categories which are python packages, one of them is called array. To register the nodes, those packages and modules are imported and – that’s problably the problem – set as globals()[module_name] = _module in arm.logicnode.__init__. That’s why the fbx importer imports the wrong array package. But without that line above, the logic nodes wouldn’t be properly registered, so we will need to rethink how that should work.

Edit: I got it working but this will only solve naming conflicts with packages, not with individual nodes (they have pretty unique names but its still not good).

@knowledgenude What do you think of a register() function that’s called for each node that is then calling add_node() or whatever the node has to do to register?

Like this:

class MyNode(ArmLogicTreeNode):
    def register(cls):
        add_node(cls, category=PKG_AS_CATEGORY)

This could even be moved into the ArmLogicTreeNode class and only nodes that want to change the register procedure would need to override the method. Categories and sections could be declared as variables instead.

I don’t understand python by the way, so i can’t confirm nothing. But i would do it for all nodes if you point the way. I don’t see any reason why not.

Also I don’t know if this is related, but there is also a bug in 2.8x following this steps:

  1. Create an object with a material
  2. Open shader editor
  3. Shift + A works as expected
  4. Disable Armory
  5. Shift + A don’t works anymore

Only works after restarting blender, i don’t know if this is intentional.

1 Like

I see. Will that be fixed in next version or github version?

Thanks. So I have to modify all array node haxe files and change like Array to AArray?

I will open a PR later today if everything is working to plan :slight_smile: You can then use the git version tomorrow or wait until the next SDK is released. No need to modify the files yourself. If you don’t want to wait, go to SDK/Armory/blender/arm/logicnode and rename the array folder (only a workaround, not the actual solution of course).

@knowledgenude I was just asking about the API, but I think it looks ok. Also thanks for the report, good catch!

1 Like

Thanks! I will go for git version

1 Like

Has downloaded the newest git version.

1 Like

A new problem: When the new version of Armory is installed, the game can’t enter play mode

Traceback (most recent call last):
File “C:\Blender 2.83\2.83\scripts\addons\ArmorySDK//armory/blender\arm\props_ui.py”, line 728, in execute
File “C:\Blender 2.83\2.83\scripts\addons\ArmorySDK//armory/blender\arm\make.py”, line 483, in play
build(target=runtime_to_target(), is_play=True)
File “C:\Blender 2.83\2.83\scripts\addons\ArmorySDK//armory/blender\arm\make.py”, line 371, in build
export_data(fp, sdk_path)
File “C:\Blender 2.83\2.83\scripts\addons\ArmorySDK//armory/blender\arm\make.py”, line 124, in export_data
ArmoryExporter.export_scene(bpy.context, asset_path, scene=scene, depsgraph=depsgraph)
File “C:\Blender 2.83\2.83\scripts\addons\ArmorySDK//armory/blender\arm\exporter.py”, line 153, in export_scene
cls(context, filepath, scene, depsgraph).execute()
File “C:\Blender 2.83\2.83\scripts\addons\ArmorySDK//armory/blender\arm\exporter.py”, line 2088, in execute
self.export_object(bobject, self.scene)
File “C:\Blender 2.83\2.83\scripts\addons\ArmorySDK//armory/blender\arm\exporter.py”, line 975, in export_object
self.post_export_object(bobject, out_object, object_type)
File “C:\Blender 2.83\2.83\scripts\addons\ArmorySDK//armory/blender\arm\exporter.py”, line 2339, in post_export_object
for b in bobject.arm_rb_collision_filter_mask:
AttributeError: ‘Object’ object has no attribute ‘arm_rb_collision_filter_mask’

location: :-1

Is that similar to the issue with FBX?

Hm, are you sure that Armory installed correctly without errors? I can’t reproduce this and the error message looks like there were some issues when installing the addon. Does it still happen when you disable and enable it again (the typical tech support answer :D)?

This still happens.
I clone armory with node fix (not SDK) from Github, and the SDK version is 2020.10

I have updated SDK through Blender. The problem is fixed.
Thanks for your patience!