Skip to content
Snippets Groups Projects
__init__.py 38.8 KiB
Newer Older
  • Learn to ignore specific revisions
  •                 bunchiness=self.bObject)
            timings.add('objcreation')
    
            if self.showMarkers:
                obj_markers.parent = obj_new
    
            self.updateTree = False
    
            if self.timePerformance:
                timings.add('Total')
                print(timings)
    
            return {'FINISHED'}
    
        def draw(self, context):
            layout = self.layout
    
            layout.prop(self, 'updateTree', icon='MESH_DATA')
    
            columns = layout.row()
            col1 = columns.column()
            col2 = columns.column()
    
            box = col1.box()
    
            box.label(text="Generation Settings:")
    
            box.prop(self, 'randomSeed')
            box.prop(self, 'maxIterations')
    
            box = col1.box()
    
            box.label(text="Shape Settings:")
    
            box.prop(self, 'numberOfEndpoints')
            box.prop(self, 'internodeLength')
            box.prop(self, 'influenceRange')
            box.prop(self, 'killDistance')
            box.prop(self, 'power')
            box.prop(self, 'scale')
            box.prop(self, 'tropism')
    
            newbox = col2.box()
    
            newbox.label(text="Crown shape")
    
            newbox.prop(self, 'useGroups')
            if self.useGroups:
    
                newbox.label(text="Object groups defining crown shape")
    
                groupbox = newbox.box()
                groupbox.prop(self, 'crownGroup')
                groupbox = newbox.box()
                groupbox.alert = (self.shadowGroup == self.crownGroup)
                groupbox.prop(self, 'shadowGroup')
                groupbox = newbox.box()
                groupbox.alert = (self.exclusionGroup == self.crownGroup)
                groupbox.prop(self, 'exclusionGroup')
            else:
    
                newbox.label(text="Simple ellipsoid defining crown shape")
    
                newbox.prop(self, 'crownSize')
                newbox.prop(self, 'crownShape')
                newbox.prop(self, 'crownOffset')
            newbox = col2.box()
            newbox.prop(self, 'useTrunkGroup')
            if self.useTrunkGroup:
                newbox.prop(self, 'trunkGroup')
    
            box.prop(self, 'surfaceBias')
            box.prop(self, 'topBias')
            box.prop(self, 'newEndPointsPer1000')
    
            box = col2.box()
    
            box.label(text="Skin options:")
    
            box.prop(self, 'noModifiers')
            if not self.noModifiers:
                box.prop(self, 'skinMethod')
                box.prop(self, 'subSurface')
    
            layout.prop(self, 'addLeaves', icon='MESH_DATA')
            if self.addLeaves:
                box = layout.box()
    
                box.label(text="Leaf Settings:")
    
                box.prop(self, 'pLeaf')
                box.prop(self, 'bLeaf')
                box.prop(self, 'leafSize')
                box.prop(self, 'leafRandomSize')
                box.prop(self, 'leafRandomRot')
    
                box.prop(self, 'leafMaxConnections')
    
            layout.prop(self, 'addObjects', icon='MESH_DATA')
            if self.addObjects:
                box = layout.box()
    
                box.label(text="Object Settings:")
    
                box.prop(self, 'objectName')
                box.prop(self, 'pObject')
                box.prop(self, 'bObject')
                box.prop(self, 'objectSize')
                box.prop(self, 'objectRandomSize')
                box.prop(self, 'objectRandomRot')
                box.prop(self, 'objectMaxConnections')
    
            box = layout.box()
    
            box.label(text="Debug Settings:")
    
            box.prop(self, 'showMarkers')
            if self.showMarkers:
                box.prop(self, 'markerScale')
            box.prop(self, 'timePerformance')
    
    
    
    Michel Anders's avatar
    Michel Anders committed
    def menu_func(self, context):
    
        self.layout.operator(
            SCATree.bl_idname, text="Add Tree to Scene",
            icon='PLUGIN').updateTree = True
    
    Michel Anders's avatar
    Michel Anders committed
    
    def register():
    
        bpy.utils.register_module(__name__)
    
        bpy.types.VIEW3D_MT_mesh_add.append(menu_func)
    
    Michel Anders's avatar
    Michel Anders committed
    
    
    def unregister():
    
        bpy.types.VIEW3D_MT_mesh_add.remove(menu_func)
    
        bpy.utils.unregister_module(__name__)
    
    Michel Anders's avatar
    Michel Anders committed
    
    
    if __name__ == "__main__":