Changeset View
Changeset View
Standalone View
Standalone View
io_scene_fbx/export_fbx_bin.py
| Context not available. | |||||
| """ | """ | ||||
| Store custom properties of blender ID bid (any mapping-like object, in fact) into FBX properties props. | Store custom properties of blender ID bid (any mapping-like object, in fact) into FBX properties props. | ||||
| """ | """ | ||||
| for k, v in bid.items(): | items = bid.items() | ||||
| rna_properties = {prop.identifier for prop in bid.bl_rna.properties if prop.is_runtime} if items else None | |||||
mont29: Just do early return if items is empty, much simpler ;) | |||||
| for k, v in items: | |||||
| if k == '_RNA_UI' or k in rna_properties: | |||||
mont29Unsubmitted Not Done Inline ActionsI would consider excluding any prop which name starts with _, so something like that instead: if not k or k[:1] == "_" or k in rna_properties: mont29: I would consider excluding any prop which name starts with `_`, so something like that instead… | |||||
lichtwerkAuthorUnsubmitted Not Done Inline Actionsnot sure... lichtwerk: not sure...
I think we could/should be specific about stuff that causes problems from the… | |||||
| continue | |||||
| list_val = getattr(v, "to_list", lambda: None)() | list_val = getattr(v, "to_list", lambda: None)() | ||||
| if isinstance(v, str): | if isinstance(v, str): | ||||
| Context not available. | |||||
| # For now, do not use world textures, don't think they can be linked to anything FBX wise... | # For now, do not use world textures, don't think they can be linked to anything FBX wise... | ||||
| for ma in data_materials.keys(): | for ma in data_materials.keys(): | ||||
| # Note: with nodal shaders, we'll could be generating much more textures, but that's kind of unavoidable, | # Note: with nodal shaders, we'll could be generating much more textures, but that's kind of unavoidable, | ||||
| #! given that textures actually do not exist anymore in material context in Blender... | # given that textures actually do not exist anymore in material context in Blender... | ||||
| ma_wrap = node_shader_utils.PrincipledBSDFWrapper(ma, is_readonly=True) | ma_wrap = node_shader_utils.PrincipledBSDFWrapper(ma, is_readonly=True) | ||||
| for sock_name, fbx_name in PRINCIPLED_TEXTURE_SOCKETS_TO_FBX: | for sock_name, fbx_name in PRINCIPLED_TEXTURE_SOCKETS_TO_FBX: | ||||
| tex = getattr(ma_wrap, sock_name) | tex = getattr(ma_wrap, sock_name) | ||||
| Context not available. | |||||
Just do early return if items is empty, much simpler ;)