[Bf-extensions-cvs] [e813b903] master: Ant Landscape: fix requested ui changes
Jimmy Hazevoet
noreply at git.blender.org
Sat Jun 17 16:52:59 CEST 2017
Commit: e813b903c340fdc1edb2d51c4c5c492a55f367bf
Author: Jimmy Hazevoet
Date: Sun Jun 18 00:52:25 2017 +1000
Branches: master
https://developer.blender.org/rBAe813b903c340fdc1edb2d51c4c5c492a55f367bf
Ant Landscape: fix requested ui changes
===================================================================
A ant_landscape/ErosionR.txt
M ant_landscape/__init__.py
M ant_landscape/add_mesh_ant_landscape.py
M ant_landscape/ant_functions.py
M ant_landscape/ant_landscape_refresh.py
A ant_landscape/eroder.py
M ant_landscape/mesh_ant_displace.py
A ant_landscape/stats.py
A ant_landscape/test.py
A ant_landscape/utils.py
A presets/operator/mesh.landscape_add/billow.py
A presets/operator/mesh.landscape_add/canions.py
A presets/operator/mesh.landscape_add/mounds.py
R078 presets/operator/mesh.landscape_add/smooth_terrain.py presets/operator/mesh.landscape_add/ridged.py
===================================================================
diff --git a/ant_landscape/ErosionR.txt b/ant_landscape/ErosionR.txt
new file mode 100644
index 00000000..1dae7aa0
--- /dev/null
+++ b/ant_landscape/ErosionR.txt
@@ -0,0 +1,2 @@
+http://blog.michelanders.nl/search/label/erosion
+https://github.com/nerk987/ErosionR
\ No newline at end of file
diff --git a/ant_landscape/__init__.py b/ant_landscape/__init__.py
index 02f66ec4..4b389184 100644
--- a/ant_landscape/__init__.py
+++ b/ant_landscape/__init__.py
@@ -16,14 +16,14 @@
#
# ##### END GPL LICENSE BLOCK #####
-# Another Noise Tool - Suite
+# Another Noise Tool - Suite (W.I.P.)
# Jim Hazevoet 5/2017
bl_info = {
"name": "A.N.T.Landscape",
"author": "Jim Hazevoet",
- "version": (0, 1, 6),
- "blender": (2, 77, 0),
+ "version": (0, 1, 7),
+ "blender": (2, 78, 0),
"location": "View3D > Tool Shelf",
"description": "Another Noise Tool: Landscape and Displace",
"warning": "",
@@ -54,18 +54,22 @@ from bpy.props import (
PointerProperty,
EnumProperty,
)
-'''
+
from .ant_functions import (
draw_ant_refresh,
draw_ant_main,
draw_ant_noise,
draw_ant_displace,
)
-'''
+
# ------------------------------------------------------------
# Menu and panels
+def menu_func_eroder(self, context):
+ #self.layout.operator(Eroder.bl_idname, text="Eroder", icon='RNDCURVE')
+ self.layout.operator('mesh.eroder', text="Eroder", icon='RNDCURVE')
+
# Define "Landscape" menu
def menu_func_landscape(self, context):
self.layout.operator('mesh.landscape_add', text="Landscape", icon="RNDCURVE")
@@ -76,7 +80,7 @@ class panel_func_add_landscape(bpy.types.Panel):
bl_space_type = "VIEW_3D"
bl_context = "objectmode"
bl_region_type = "TOOLS"
- bl_label = "ANT Landscape"
+ bl_label = "Landscape"
bl_category = "Create"
bl_options = {'DEFAULT_CLOSED'}
@@ -90,37 +94,41 @@ class AntLandscapeToolsPanel(bpy.types.Panel):
bl_space_type = "VIEW_3D"
bl_context = "objectmode"
bl_region_type = "TOOLS"
- bl_label = "ANT Displace/Slopemap"
+ bl_label = "Landscape Tools"
bl_category = "Tools"
bl_options = {'DEFAULT_CLOSED'}
+ @classmethod
+ def poll(cls, context):
+ ob = bpy.context.active_object
+ return (ob and ob.type == 'MESH')
+
def draw(self, context):
layout = self.layout
ob = context.active_object
if ob and ob.type == 'MESH':
- box = layout.box()
- col = box.column()
- col.label("Mesh:")
- col.operator('mesh.ant_displace', text="Displace", icon="RNDCURVE")
- col = box.column()
+ col = layout.column()
+ col.operator('mesh.ant_displace', text="Mesh Displace", icon="RNDCURVE")
+ col.operator('mesh.eroder', text="Landscape Eroder", icon='SMOOTHCURVE')
col.operator('mesh.ant_slope_map', icon='GROUP_VERTEX')
else:
box = layout.box()
- col = box.column()
- col.label("Select a Mesh Object")
+ box.label("Select a Mesh!", icon='ERROR')
-# Landscape Settings:
-class AntLandscapeSettingsPanel(bpy.types.Panel):
- bl_space_type = "VIEW_3D"
- bl_context = "objectmode"
- bl_region_type = "TOOLS"
- bl_category = "Create"
+# Landscape Settings / Properties:
+class AntMainSettingsPanel(bpy.types.Panel):
+ bl_idname = "ANTMAIN_PT_layout"
bl_options = {'DEFAULT_CLOSED'}
- bl_label = "ANT Landscape Settings"
- # bl_space_type = 'PROPERTIES'
- # bl_region_type = 'WINDOW'
- # bl_context = "world"
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'UI'
+ bl_context = "object"
+ bl_label = "Landscape Main"
+
+ @classmethod
+ def poll(cls, context):
+ ob = bpy.context.active_object.ant_landscape.keys()
+ return ob
def draw(self, context):
layout = self.layout
@@ -130,200 +138,256 @@ class AntLandscapeSettingsPanel(bpy.types.Panel):
if ob and ob.ant_landscape.keys():
ant = ob.ant_landscape
box = layout.box()
- split = box.column().row().split()
- split.scale_y = 1.5
- split.operator('mesh.ant_landscape_regenerate', text="", icon="LOOP_FORWARDS")
- split.operator('mesh.ant_landscape_refresh', text="", icon="FILE_REFRESH")
-
+ col = box.column(align=False)
+ col.scale_y = 1.5
+ col.operator('mesh.ant_landscape_regenerate', text="Regenerate", icon="LOOP_FORWARDS")
+ row = box.row(align=True)
+ split = row.split(align=True)
+ split.prop(ant, "smooth_mesh", toggle=True, text="Smooth", icon='SOLID')
+ split.prop(ant, "tri_face", toggle=True, text="Triangulate", icon='MESH_DATA')
+ if ant.sphere_mesh:
+ split.prop(ant, "remove_double", toggle=True, text="Remove Doubles", icon='MESH_DATA')
+ box.prop(ant, "ant_terrain_name")
+ box.prop_search(ant, "land_material", bpy.data, "materials")
+ col = box.column(align=True)
+ col.prop(ant, "subdivision_x")
+ col.prop(ant, "subdivision_y")
+ col = box.column(align=True)
+ if ant.sphere_mesh:
+ col.prop(ant, "mesh_size")
+ else:
+ col.prop(ant, "mesh_size_x")
+ col.prop(ant, "mesh_size_y")
+ else:
box = layout.box()
- box.prop(ant, "show_main_settings", toggle=True)
- if ant.show_main_settings:
- #row = box.row(align=True)
- #split = row.split(align=True)
- #split.prop(ant, "at_cursor", toggle=True, icon_only=True, icon='CURSOR')
- #split.prop(ant, "smooth_mesh", toggle=True, icon_only=True, icon='SOLID')
- #split.prop(ant, "sphere_mesh", toggle=True)
- #split.prop(ant, "tri_face", toggle=True, icon_only=True, icon='MESH_DATA')
- #box.prop(ant, "ant_terrain_name")
- #box.prop_search(ant, "land_material", bpy.data, "materials")
- col = box.column(align=True)
- col.prop(ant, "subdivision_x")
- col.prop(ant, "subdivision_y")
- col = box.column(align=True)
- if ant.sphere_mesh:
- col.prop(ant, "mesh_size")
- else:
- col.prop(ant, "mesh_size_x")
- col.prop(ant, "mesh_size_y")
+ box.label("Select a Landscape Object!", icon='ERROR')
- box = layout.box()
- box.prop(ant, "show_noise_settings", toggle=True)
- if ant.show_noise_settings:
- box.prop(ant, "noise_type")
- if ant.noise_type == "blender_texture":
- box.prop_search(ant, "texture_block", bpy.data, "textures")
- else:
- box.prop(ant, "basis_type")
- col = box.column(align=True)
- col.prop(ant, "random_seed")
- col = box.column(align=True)
- col.prop(ant, "noise_offset_x")
- col.prop(ant, "noise_offset_y")
- col.prop(ant, "noise_offset_z")
- col.prop(ant, "noise_size_x")
- col.prop(ant, "noise_size_y")
+# Landscape Settings / Properties:
+class AntNoiseSettingsPanel(bpy.types.Panel):
+ bl_idname = "ANTNOISE_PT_layout"
+ bl_options = {'DEFAULT_CLOSED'}
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'UI'
+ bl_context = "object"
+ bl_label = "Landscape Noise"
+
+ @classmethod
+ def poll(cls, context):
+ ob = bpy.context.active_object.ant_landscape.keys()
+ return ob
+
+ def draw(self, context):
+ layout = self.layout
+ scene = context.scene
+ ob = bpy.context.active_object
+
+ if ob and ob.ant_landscape.keys():
+ ant = ob.ant_landscape
+
+ box = layout.box()
+ col = box.column(align=True)
+ col.scale_y = 1.5
+ if ant.sphere_mesh:
+ col.operator('mesh.ant_landscape_regenerate', text="Regenerate", icon="LOOP_FORWARDS")
+ else:
+ col.operator('mesh.ant_landscape_refresh', text="Refresh", icon="FILE_REFRESH")
+
+ box.prop(ant, "noise_type")
+ if ant.noise_type == "blender_texture":
+ box.prop_search(ant, "texture_block", bpy.data, "textures")
+ else:
+ box.prop(ant, "basis_type")
+
+ col = box.column(align=True)
+ col.prop(ant, "random_seed")
+ col = box.column(align=True)
+ col.prop(ant, "noise_offset_x")
+ col.prop(ant, "noise_offset_y")
+ col.prop(ant, "noise_offset_z")
+ col.prop(ant, "noise_size_x")
+ col.prop(ant, "noise_size_y")
+ if ant.sphere_mesh:
col.prop(ant, "noise_size_z")
+ col = box.column(align=True)
+ col.prop(ant, "noise_size")
+
+ col = box.column(align=True)
+ if ant.noise_type == "multi_fractal":
+ col.prop(ant, "noise_depth")
+ col.prop(ant, "dimension")
+ col.prop(ant, "lacunarity")
+ elif ant.noise_type == "ridged_multi_fractal":
+ col.prop(ant, "noise_depth")
+ col.prop(ant, "dimension")
+ col.prop(ant, "lacunarity")
+ col.prop(ant, "offset")
+ col.prop(ant, "gain")
+ elif ant.noise_type == "hybrid_multi_fractal":
+ col.prop(ant, "noise_depth")
+ col.prop(ant, "dimension")
+ col.prop(ant, "lacunarity")
+ col.prop(ant, "offset")
+ col.prop(ant, "gain")
+ elif ant.noise_type == "hetero_terrain":
+ col.prop(ant, "noise_depth")
+ col.prop(ant, "dimension")
+ col.prop(ant, "lacunarity")
+ col.prop(ant, "offset")
+ elif ant.noise_type == "fractal":
+ col.prop(ant, "noise_depth")
+ c
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list