]> git.tdb.fi Git - libs/gl.git/blob - blender/io_mspgl/properties.py
129b02e64829b125cd5ffe76e2a4f93b112d0f1d
[libs/gl.git] / blender / io_mspgl / properties.py
1 import bpy
2
3 class MspGLMeshProperties(bpy.types.Panel):
4         bl_idname = "MESH_PT_mspgl_properties"
5         bl_label = "MspGL properties"
6         bl_space_type = "PROPERTIES"
7         bl_region_type = "WINDOW"
8         bl_context = "data"
9
10         @classmethod
11         def poll(cls, context):
12                 return context.active_object.type=="MESH"
13
14         def draw(self, context):
15                 mesh = context.active_object.data
16
17                 self.layout.prop(mesh, "winding_test")
18
19 class MspGLObjectProperties(bpy.types.Panel):
20         bl_idname = "OBJECT_PT_mspgl_properties"
21         bl_label = "MspGL properties"
22         bl_space_type = "PROPERTIES"
23         bl_region_type = "WINDOW"
24         bl_context = "object"
25
26         def draw(self, context):
27                 obj = context.active_object
28
29                 self.layout.prop(obj, "technique");
30                 self.layout.prop(obj, "inherit_tech");
31                 if obj.inherit_tech:
32                         self.layout.prop(obj, "override_material");
33                 self.layout.prop(obj, "compound");
34                 self.layout.prop(obj, "lod_for_parent")
35                 if obj.lod_for_parent:
36                         self.layout.prop(obj, "lod_index")
37
38 def register_properties():
39         bpy.types.Mesh.winding_test = bpy.props.BoolProperty(name="Winding test", description="Perform winding test to skip back faces")
40         bpy.types.Object.technique = bpy.props.StringProperty(name="Technique", description="Name of the technique to use for rendering")
41         bpy.types.Object.inherit_tech = bpy.props.BoolProperty(name="Inherit technique", description="Inherit from the technique to customize textures")
42         bpy.types.Object.override_material = bpy.props.BoolProperty(name="Override material", description="Override material in the inherited texture as well", default=True)
43         bpy.types.Object.compound = bpy.props.BoolProperty(name="Compound with parent", description="Join this object to its parent when exporting")
44         bpy.types.Object.lod_for_parent = bpy.props.BoolProperty(name="LoD for parent", description="This object is a level of detail for its parent")
45         bpy.types.Object.lod_index = bpy.props.IntProperty(name="LoD index", description="Index of the level of detail", min=1, default=1)