obj.setLocation(*Blender.Window.GetCursorPos()) if Orientation.value == XZ: pass elif Orientation.value == XY: obj.RotY = pi / 2.0 elif Orientation.value == YZ: obj.RotX = pi / 2.0 # GUI interface = gui.Interface() Create = gui.Button(interface, 'Create', callback=create) Smooth = gui.Toggle(interface, 'Smooth', True) # basic settings MajorRadius = gui.FloatNumber(interface, '', 1.0, 0.00001, 1.0e8) MinorRadius = gui.FloatNumber(interface, '', 0.25, 0.00001, 1.0e8) MajorDivisions = gui.IntNumber(interface, '', 32, 3, 1024) MinorDivisions = gui.IntNumber(interface, '', 16, 3, 1024) StartMinorAngle = gui.FloatSlider(interface, '', 0, 0, 360) # extended StartMajorAngle = gui.FloatSlider(interface, '', 0, 0, 360) EndMajorAngle = gui.FloatSlider(interface, '', 0, 0, 360) CapStart = gui.Toggle(interface, 'cap', True, tooltip="Cap start") CapEnd = gui.Toggle(interface, 'cap', True, tooltip="Cap end") Cut = gui.Toggle(interface, 'Cut torus', False)
90, 200, [2, 15], draw_canvas.set_stroke, gameDisplay, evManager=controller), gui.TextBoxEvent(537, 300, 176, 30, "Draw / Erase", gameDisplay, evManager=controller), gui.Toggle(537, 340, 176, 60, draw_canvas.set_state, gameDisplay, evManager=controller), events.KeyboardController(evManager=controller), draw_canvas, render_canvas, gui.Button('SAVE', input_func, gameDisplay, evManager=controller, rect=gui.Rect(537, 410, 176, 40)), gui.Button('CLEAR', draw_canvas.clear, gameDisplay, evManager=controller, rect=gui.Rect(537, 460, 176, 40))
obj.setLocation( *Blender.Window.GetCursorPos() ) if Orientation.value == XZ: pass elif Orientation.value == XY: obj.RotY = pi/2.0 elif Orientation.value == YZ: obj.RotX = pi/2.0 interface = gui.Interface('Mesh Sphere $Revision: 1.1.1.1 $') Radius = gui.FloatNumber(interface, '', 1, 0.001, 1.0e8) UDivisions = gui.IntNumber(interface, 'U: ', 16, 3, 1024) VDivisions = gui.IntNumber(interface, 'V: ', 16, 3, 1024) Smooth = gui.Toggle(interface, 'Smooth', True) Create = gui.Button(interface, 'Create', callback=create) Hemisphere = gui.Toggle(interface, 'Hemisphere', False) Cap = gui.Toggle(interface, 'Cap', True) CapMethod = gui.MultipleToggle(interface, ['simple', 'symmetrical'], 0) Percent = gui.FloatSlider(interface, '', 50, 0, 100) Origin = gui.MultipleToggle(interface, [ ('World center',CENTER), ('3D cursor',CURSOR) ], 0, tooltip="Origin") Orientation = gui.RadioButtons(interface, [('xz',XZ), ('xy',XY), ('yz',YZ)], XZ, tooltip="Orientation") rows = gui.Rows(interface, 10, 10, 300, 20, padx=4) rows.addrow( gui.Text(interface, 'Sphere radius') ) rows.addvspace("quarter") rows.addrow( Radius )
### Make widgets # dimensions InnerRadius = gui.FloatNumber(interface, '', 1.0, 0.0001, 1.0e8, tooltip='Inner radius') OuterRadius = gui.FloatNumber(interface, '', 2.0, 0.0001, 1.0e8, tooltip='Outer radius') Height = gui.FloatNumber(interface, '', 5.0, 0.0001, 1.0e8, tooltip='Height') # accuracy InnerDivisions = gui.IntNumber(interface, '', 1, 1, 512, tooltip="Inner divisions") OuterDivisions = gui.IntNumber(interface, '', 1, 1, 512, tooltip="Outer divisions") CapDivisions = gui.IntNumber(interface, '', 1, 1, 256, tooltip="Cap divisions") Segments = gui.IntNumber(interface, '', 32, 3, 1024, tooltip="Segments") # cut UseAngles = gui.Toggle(interface, 'Cut tube', False) StartAngle = gui.FloatSlider(interface, '', 0, 0, 360) EndAngle = gui.FloatSlider(interface, '', 0, 0, 360) # origin & orientation Origin = gui.MultipleToggle(interface, [ ('World center',CENTER), ('3D cursor',CURSOR) ], 0, tooltip="Origin") Orientation = gui.RadioButtons(interface, [('xz',XZ), ('xy',XY), ('yz',YZ)], XZ, tooltip="Orientation") # Create = gui.Button(interface, 'Create', callback=create) Smooth = gui.Toggle(interface, 'Smooth', True, 'Smooth mesh') # place widgets at container rows = gui.Rows(interface, 10, 10, 300, padx=4) def _(text): return gui.Text(interface, text, align="right")
#UseAngles = gui.Toggle(interface, 'Cut tube', False) #StartAngle = gui.FloatSlider(interface, '', 0, 0, 360) #EndAngle = gui.FloatSlider(interface, '', 0, 0, 360) # origin & orientation Origin = gui.MultipleToggle(interface, [('World center', CENTER), ('3D cursor', CURSOR)], 0, tooltip="Origin") Orientation = gui.RadioButtons(interface, [('xz', XZ), ('xy', XY), ('yz', YZ)], XZ, tooltip="Orientation") # Create = gui.Button(interface, 'Create', callback=create) Smooth = gui.Toggle(interface, 'Smooth', True, 'Smooth mesh') # place widgets at container rows = gui.Rows(interface, 10, 10, 300, padx=4) def _(text): return gui.Text(interface, text, align="right") rows.addrow([(_("Radius: "), 0.4), Radius]).addvspace("quarter") rows.addrow([(_("Height: "), 0.4), Height]).addvspace() rows.addrow([(_("Segments: "), 0.4), Segments]).addvspace("quarter") rows.addrow([(_("Outer divisions: "), 0.4), OuterDivisions]).addvspace("quarter")
'End: ', 100.0, 0.0, 100.0, callback=live_update) Axis = gui.RadioButtons(interface, [('X', AXIS_X), ('Y', AXIS_Y), ('Z', AXIS_Z)], AXIS_Y, callback=live_update) Angle = gui.FloatSlider(interface, 'Angle: ', 0.0, 0.0, 360.0 * 100, callback=live_update) LiveUpdate = gui.Toggle(interface, 'Live update', False) Info = gui.Text(interface, 'No mesh selected', align='center') GetMesh = gui.Button(interface, 'Get mesh', callback=get_selected) Cancel = gui.Button(interface, 'Cancel', callback=cancel) Apply = gui.Button(interface, 'Apply', callback=apply) Update = gui.Button(interface, 'Update', callback=update) rows = gui.Rows(interface, 10, 10, 250, 20) rows.addrow(Info).addvspace('half') rows.addrow(StartFrom) rows.addrow(EndAt).addvspace('half') rows.addrow(Axis)