[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2482] branches/geodesic_domes/gui_259. py: version 0.2 now really
Peter K.H. Gragert
pkhgragert at gmail.com
Tue Oct 18 13:11:17 CEST 2011
Revision: 2482
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2482
Author: pkhg
Date: 2011-10-18 11:11:17 +0000 (Tue, 18 Oct 2011)
Log Message:
-----------
version 0.2 now really
Modified Paths:
--------------
branches/geodesic_domes/gui_259.py
Modified: branches/geodesic_domes/gui_259.py
===================================================================
--- branches/geodesic_domes/gui_259.py 2011-10-18 11:08:32 UTC (rev 2481)
+++ branches/geodesic_domes/gui_259.py 2011-10-18 11:11:17 UTC (rev 2482)
@@ -19,40 +19,40 @@
# ##### END GPL LICENSE BLOCK #####
# first try for an GUI : gui_259.py
-'''not yet ab addon PKHG 20111012
-bl_info = {
- "name": "Geodesic Dome",
- "author": "PKHG, Kilon, original for 2.49 from Andy Houston ",
- "version": (0,0,1),
- "blender": (2, 5, 9),
- "api": 39685,
- "location": "View3D > Tool Shelf > Geodesic Dome Panel",
- "description": "Choice for objects",
- "warning": "",
- "wiki_url": "",
- "tracker_url": "",
- "category": "Mesh"}
-'''
+
"""
-Rev 0.1 building menues PKHG
+Rev 0.2 building menues PKHG
"""
-from geodesic_domes import geodesic_259 as geodesic
-#print(dir(geodesic))
+
import bpy
from math import *
from bpy.props import EnumProperty, IntProperty, FloatProperty, StringProperty, BoolProperty
-import sys
-# Defintions of variables
-#sys.path.append("c:\\")
-#typesOfObjects =["Geodesic", "Grid", "Cylinder", "Parabola", "Torus", "Ball", "Your mesh"]
-#sys.path.append("c:\\Users\\Peter\\25blender\\blenderlatest\\2.59\\scripts\\addons\\geodesicDome")
+## Superformula controls
+bpy.types.Scene.superformula_um = FloatProperty(name = 'um', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 3)
+bpy.types.Scene.superformula_un1 = FloatProperty(name = 'un1', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 10.0)
+bpy.types.Scene.superformula_un2 = FloatProperty(name = 'un2', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 10.0)
+bpy.types.Scene.superformula_un3 = FloatProperty(name = 'un3', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 10.0)
+bpy.types.Scene.superformula_ua = FloatProperty(name = 'ua', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 1.0)
+bpy.types.Scene.superformula_ub = FloatProperty(name = 'ub', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 1.0)
+bpy.types.Scene.superformula_vm = FloatProperty(name = 'vm', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 4)
+bpy.types.Scene.superformula_vn1 = FloatProperty(name = 'vn1', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 10.0)
+bpy.types.Scene.superformula_vn2 = FloatProperty(name = 'vn2', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 10.0)
+bpy.types.Scene.superformula_vn3 = FloatProperty(name = 'vn3', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 10.0)
+bpy.types.Scene.superformula_va = FloatProperty(name = 'va', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 1.0)
+bpy.types.Scene.superformula_vb = FloatProperty(name = 'vb', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 1.0)
+bpy.types.Scene.superformula_uact = FloatProperty(name = 'uact', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 0)
+bpy.types.Scene.superformula_vact = FloatProperty(name = 'vact', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 0)
+bpy.types.Scene.superformula_uturn = FloatProperty(name = 'uturn', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 0.0)
+bpy.types.Scene.superformula_vturn = FloatProperty(name = 'vturn', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 0.0)
+bpy.types.Scene.superformula_utwist = FloatProperty(name = 'utwist', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 0.0)
+bpy.types.Scene.superformula_vtwist = FloatProperty(name = 'vtwist', min = 1, soft_min=0.1, soft_max=5,max = 10, default = 0.0)
-bpy.types.Scene.grid_xres= IntProperty(name="X res",min = 1, soft_max=10, max = 20, default = 2)
-bpy.types.Scene.grid_yres= IntProperty(name="Y res",min = 1, soft_max=10, max = 20, default = 2)
-bpy.types.Scene.grid_x_size = FloatProperty(name="X size",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
-bpy.types.Scene.grid_y_size = FloatProperty(name="Y size",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
+bpy.types.Scene.grid_xres = IntProperty(name="X res",min = 1, soft_min = 2, soft_max=10, max = 20, default = 2)
+bpy.types.Scene.grid_yres = IntProperty(name="Y res",min = 1, soft_min = 2, soft_max=10, max = 20, default = 2)
+bpy.types.Scene.grid_xsize = FloatProperty(name = "X size", min = 1, soft_min=0.1, soft_max=5,max = 10, default = 2.0)
+bpy.types.Scene.grid_ysize = FloatProperty(name="Y size",min = 1, soft_min=0.1, soft_max=5,max = 10, default = 1.0)
#for Cylinder
bpy.types.Scene.cylinder_xres= IntProperty(name="X res",min = 1, soft_max=10, max = 20, default = 2)
bpy.types.Scene.cylinder_yres= IntProperty(name="Y res",min = 1, soft_max=10, max = 20, default = 2)
@@ -80,16 +80,16 @@
bpy.types.Scene.torus_ygap = FloatProperty(name="Y Gap",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
bpy.types.Scene.torus_xgap_rotate = FloatProperty(name="X Gap rotate",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
bpy.types.Scene.torus_ygap_rotate = FloatProperty(name="Y Gap rotate",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
-#for ball
-bpy.types.Scene.ball_xres= IntProperty(name="X/y res",min = 1, soft_max=10, max = 20, default = 2)
-bpy.types.Scene.ball_yres= IntProperty(name="Z res",min = 1, soft_max=10, max = 20, default = 2)
-bpy.types.Scene.ball_x_radius = FloatProperty(name="Radius",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
-bpy.types.Scene.ball_x_stretch = FloatProperty(name="X stretch",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
-bpy.types.Scene.ball_y_stretch = FloatProperty(name="Y stretch",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
-bpy.types.Scene.ball_xgap = FloatProperty(name="X Gap",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
-bpy.types.Scene.ball_ygap = FloatProperty(name="Y Gap",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
-# bpy.types.Scene.ball_xgap_rotate = FloatProperty(name="X Gap rotate",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
-# bpy.types.Scene.ball_ygap_rotate = FloatProperty(name="Y Gap rotate",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
+#for sphere
+bpy.types.Scene.sphere_xres= IntProperty(name="X/Y res",min = 4, soft_max=20, max = 36, default = 8)
+bpy.types.Scene.sphere_yres= IntProperty(name="Z res",min = 4, soft_max=20, max = 36, default = 8)
+bpy.types.Scene.sphere_x_radius = FloatProperty(name="Radius",min = 1, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
+bpy.types.Scene.sphere_x_stretch = FloatProperty(name="X stretch",min = 1, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
+bpy.types.Scene.sphere_y_stretch = FloatProperty(name="Y stretch",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
+bpy.types.Scene.sphere_xgap = FloatProperty(name="X Gap",min = 1, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
+bpy.types.Scene.sphere_ygap = FloatProperty(name="Y Gap",min = 1, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
+# bpy.types.Scene.sphere_xgap_rotate = FloatProperty(name="X Gap rotate",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
+# bpy.types.Scene.sphere_ygap_rotate = FloatProperty(name="Y Gap rotate",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
bpy.types.Scene.class_one = BoolProperty(
name="Class nr 1",
description="Class nr 1",
@@ -125,13 +125,13 @@
bpy.types.Scene.choose_type = EnumProperty(
name="Type to choose",
- description="Choose Geodesic, Grid, Cylinder,Parabola, Torus, Ball, Your mesh",
+ description="Choose Geodesic, Grid, Cylinder,Parabola, Torus, Sphere, Your mesh",
items=[("0","Geodesic","Generate Geodesic"),
("1","Grid","Generate Grid"),
("2","Cylinder","Generate Cylinder"),
("3","Parabola","Generate Parabola"),
("4","Torus","Generate Torus"),
- ("5","Ball","Generate Ball"),
+ ("5","Sphere","Generate Sphere"),
("6","Your mesh","Generate Your Mesh"),
],
@@ -172,6 +172,37 @@
WhatToDo = "GENERATE" # geodesic.getActionToDo(active_obj)
if WhatToDo == 'GENERATE':
+ col.label("superform parameters")
+ row = layout.row()
+ row.prop(context.scene,'superformula_um')
+ row.prop(context.scene,'superformula_un1')
+ row = layout.row()
+ row.prop(context.scene,'superformula_un2')
+ row.prop(context.scene,'superformula_ua')
+ row = layout.row()
+ row.prop(context.scene,'superformula_ub')
+ row.prop(context.scene,'superformula_un2')
+ row = layout.row()
+ row.prop(context.scene,'superformula_vm')
+ row.prop(context.scene,'superformula_vn1')
+ row = layout.row()
+ row.prop(context.scene,'superformula_vn2')
+ row.prop(context.scene,'superformula_va')
+ row = layout.row()
+ row.prop(context.scene,'superformula_vb')
+ row.prop(context.scene,'superformula_vn2')
+ row = layout.row()
+ row.prop(context.scene,'superformula_uact')
+ row.prop(context.scene,'superformula_vact')
+ row = layout.row()
+ row.prop(context.scene,'superformula_uturn')
+ row.prop(context.scene,'superformula_vturn')
+ row = layout.row()
+ row.prop(context.scene,'superformula_utwist')
+ row.prop(context.scene,'superformula_vtwist')
+ col = layout.column(align=True)
+ col.label(" ")
+ col.label("parameters adusted? ==>generate")
col.operator("geodesic.generate_geodesic_dome", text="Generate your object")
col = layout.column()
col.label("First choice")
@@ -217,8 +248,8 @@
row.prop(context.scene,"grid_xres")
row.prop(context.scene,"grid_yres")
row = layout.row()
- row.prop(context.scene,"grid_x_size")
- row.prop(context.scene,"grid_y_size")
+ row.prop(context.scene,"grid_xsize")
+ row.prop(context.scene,"grid_ysize")
elif tmp == 2: #cylinder
row = layout.row()
row.prop(context.scene,"cylinder_xres")
@@ -255,18 +286,18 @@
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list