I always get the following error
Warning: 'ABC_Fbx_PT_Panel' doesn't have upper case alpha-numeric prefix
But I don't really get why...
That is my code:
import bpy
from bpy_extras.io_utils import ExportHelper
from bpy.props import (StringProperty, CollectionProperty,)
from bpy.types import (Operator, OperatorFileListElement,)
class WorldOriginExport(Operator, ExportHelper):
bl_label = 'Export'
bl_idname = 'test.world_origin_export'
bl_options = {'PRESET', 'UNDO', 'REGISTER'}
files = CollectionProperty(name = 'File Path', type = OperatorFileListElement,)
directory = StringProperty(subtype = 'DIR_PATH',)
filename_ext = ''
def draw(self, context):
layout = self.layout
layout.use_property_split = False
layout.use_property_decorate = False # No animation.
sfile = context.space_data
operator = sfile.active_operator
def execute(self, context):
return {'FINISHED'}
class ABC_Gltf_PT_Panel(bpy.types.Panel):
bl_space_type = 'FILE_BROWSER'
bl_region_type = 'TOOL_PROPS'
bl_label = 'glTF Embedded / Separate'
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
sfile = context.space_data
operator = sfile.active_operator
@classmethod
def poll(cls, context):
sfile = context.space_data
operator = sfile.active_operator
return operator.bl_idname == "TEST_OT_world_origin_export"
class ABC_Fbx_PT_Panel(bpy.types.Panel):
bl_space_type = 'FILE_BROWSER'
bl_region_type = 'TOOL_PROPS'
bl_label = 'FBX'
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
sfile = context.space_data
operator = sfile.active_operator
if operator.fileType == 'GLTF_SEPARATE':
layout.enabled = False
elif operator.fileType == 'GLTF_EMBEDDED':
layout.enabled = False
else:
layout.enabled = True
@classmethod
def poll(cls, context):
sfile = context.space_data
operator = sfile.active_operator
return operator.bl_idname == "TEST_OT_world_origin_export"
def register():
bpy.utils.register_class(WorldOriginExport)
bpy.utils.register_class(ABC_Gltf_PT_Panel)
bpy.utils.register_class(ABC_Fbx_PT_Panel)
def unregister():
bpy.utils.unregister_class(ABC_Fbx_PT_Panel)
bpy.utils.unregister_class(ABC_Gltf_PT_Panel)
bpy.utils.unregister_class(WorldOriginExport)
if __name__ == '__main__':
register()
bpy.ops.test.world_origin_export('INVOKE_DEFAULT')