i tried this olod script in 31315 but refuse to wokr
by adding panel in operators’ panel
and no erros given on console
so can someone tell me what’s wrong with this register oe menu may be
in latest built
import bpy
import mathutils
from math import *
from bpy.props import *
import random
class initvar:
def __init__(self, name):
self.name = name
nmin=1.0
nmax=10.0
xrnd1=random.uniform(nmin,nmax)
yrnd1=random.uniform(nmin,nmax)
zrnd1=random.uniform(nmin,nmax)
seg1 = IntProperty(name="Segments X",
description="Number segments X",
default=16, min=4, max=100)
xloc = FloatProperty(name="X Loc",
description="X location",
default=xrnd1, min=1.0, max=100.0)
yloc = FloatProperty(name="Y Loc",
description="Y location",
default=yrnd1, min=1.0, max=100.0)
zloc = FloatProperty(name="Z Loc",
description="Z location",
default=zrnd1, min=1.0, max=100.0)
class addprimitiveparabola1(bpy.types.Operator):
bl_idname = "mesh.primitive_parabolaprimitive1_add"
bl_label = "Add Primitive Parabola"
bl_options = {'REGISTER', 'UNDO'}
span = FloatProperty(name="Base Arch Span",
description="Arch Span",
default=5.0, min=1.0, max=100.0)
rise= FloatProperty(name=" Arch rise",
description="Arch rise",
default=10.0, min=1.0, max=100.0)
aa= initvar # Instantiate the init class
seg1 =initvar.seg1
xloc =initvar.xloc
yloc =initvar.yloc
zloc =initvar.zloc
xrnd1=initvar.xrnd1
yrnd1=initvar.yrnd1
zrnd1=initvar.zrnd1
def execute(self, context):
xloc = self.properties.xloc
yloc = self.properties.yloc
zloc = self.properties.zloc
span = self.properties.span
rise = self.properties.rise
seg1 = self.properties.seg1
return {'FINISHED'}
def corner1(verts,edges,medges,start, stop, del1,edgeId,edl1,edl2,radcurv,x0,y0):
# Edl1 is First point edl2 is last point EdgeId is the last Vert index
print ('corner')
return edl3 # Return Last edgeId
class addhalfcircle2(bpy.types.Operator):
bl_idname = "mesh.primitive_halfcircle2_add"
bl_label = "Add Angle circle"
bl_options = {'REGISTER', 'UNDO'}
seg1 = IntProperty(name="Segments ",
description="Number segments ",
default=16, min=4, max=100)
span = FloatProperty(name="Base Circle",
description="base circle",
default=5.0, min=1.0, max=100.0)
ang11 = FloatProperty(name="Angle a",
description="Left Angle of Triangle",
default=36.0, min=0.01, max=360)
def execute(self, context):
span = self.properties.span
seg1 = self.properties.seg1
ang11 = self.properties.ang11
print ('circle')
return {'FINISHED'}
####################### Menu addition #####################
class infor_Roundedshapespanel1(bpy.types.Menu):
bl_idname = "infor_Roundedshapespanel1"
bl_label = "Rounded Shapes" # Menu script name
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("mesh.primitive_parabolaprimitive1_add",
text="Primitive Parabole")
layout.operator("mesh.primitive_halfcircle2_add",
text="Angle circle")
######################################################
import space_info
menu_func = (lambda self,
context: self.layout.menu("infor_Roundedshapespanel1"))
#if __name__ == "main":
# register()
Thanks for any help