[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24633] branches/blender2.4/release/ scripts/wizard_landscape_ant.py: New Version for 2.49b

Campbell Barton ideasman42 at gmail.com
Wed Nov 18 11:41:03 CET 2009


Revision: 24633
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24633
Author:   campbellbarton
Date:     2009-11-18 11:41:03 +0100 (Wed, 18 Nov 2009)

Log Message:
-----------
New Version for 2.49b

>From Jimmy Hazevoet
i have updated my A.N.T.Landscape script,
new functions are:
_Thermal erosion
_Generate new grid mesh with Triangle faces
_Select Verts/Faces by slope angle ( for making vertexgroups
for particlesystems )
_VertexColour Slope Map, ( for use with MaterialNodes )

This will be the last update for this script in this form (if
no major bugs are found)... with blender 2.5 this script will
need a complete rewrite,
i have plans for it, but i need a lot of time to do it, so i
gues a new version will not come before blender 2.6
So, next year or so i will spend time rewriting my ant script,
also i have plans for a "ANTLandscape" website with
docs and tuts.
The new script will be fully documented, and with some tutorials
on landscape rendering in blender.

Modified Paths:
--------------
    branches/blender2.4/release/scripts/wizard_landscape_ant.py

Modified: branches/blender2.4/release/scripts/wizard_landscape_ant.py
===================================================================
--- branches/blender2.4/release/scripts/wizard_landscape_ant.py	2009-11-18 10:37:32 UTC (rev 24632)
+++ branches/blender2.4/release/scripts/wizard_landscape_ant.py	2009-11-18 10:41:03 UTC (rev 24633)
@@ -8,10 +8,10 @@
 
 __author__ = "Jimmy Hazevoet"
 __url__     = ('http://wiki.blender.org/index.php/Scripts/Manual/Wizards/ANTLandscape','elysiun')
-__version__ = "v.1.05 03-2007"
+__version__ = "v.1.06 10-2009"
 __bpydoc__ = """\
 
-Another Noise Tool 'Landscape' v.1.05
+Another Noise Tool 'Landscape' v.1.06
 
 This script uses noise functions to create a terrain from a grid mesh.
 
@@ -46,7 +46,17 @@
 To create Multiple Landscapes you Must Re-Name or save the Mesh
 in Blender's F7 menu Links & Materials Panel.
 
+
 Readme:
+
+version.1.06: Oktober 2009
+_ New mesh option: Generate triangle faces
+_ New Height/Filter option: Thermal Erosion
+_ Option: Vert/Face select by slope, adjust limit to select steeper slopes, create vertexgroups for particlesystems etc..
+_ Option: VertexColour Slope Map, for use with MaterialNodes
+
+
+
 v.1.04:
 _ New G.U.I.
 _ New noise types like: 
@@ -203,6 +213,21 @@
 ###############################################################################################################
 
 
+#-----------------------------
+# Updates 2009:
+################################################################################################################
+# June 2009 v.1.05a
+# _ Mesh Option: Generate Triangle Faces
+#-----------------------------
+# Oktober 2009  v.1.06
+# _ Height/Filter Option: Thermal Erosion
+# _ Option: Vert/Face select by slope, adjust limit to select steeper slopes
+# _ Option: VertexColour Slope Map
+#
+################################################################################################################
+
+
+
 ###############################################################################################################
 #
 ##  Execute Script: Alt P 
@@ -219,13 +244,13 @@
 import string
 from string import strip
 import BPyMathutils
-from BPyMathutils import genrand
+from BPyMathutils import *
 from random import choice
 scene = Scene.GetCurrent()
 
 ###---------------------------------------------------------------------------
 
-CurVersion = 'A.N.T.Landscape v.1.05'
+CurVersion = 'A.N.T.Landscape v.1.06'
 
 ##---------------------------------------------------------------------------
 # Customise default settings: ----------------------------------------------
@@ -298,6 +323,10 @@
 Ipo_Evt  = 17
 New_Ipo_Evt=700
 
+VCol_Evt = 84
+VSel_Evt = 85
+FSel_Evt = 86
+
 ###---------------------------------------------------------------------------
 # menus
 noisetypemenu  = "Noise type: %t|multiFractal %x0|ridgedMFractal %x1|hybridMFractal %x2|heteroTerrain %x3|fBm %x4|turbulence %x5|Voronoi turb. %x6|vlNoise turb. %x7|noise %x8|cellNoise %x9|Marble %x10|lava_multiFractal %x11|slopey_noise %x12|duo_multiFractal %x13|distorted_heteroTerrain %x14|slickRock %x15|terra_turbulence %x16|rocky_fBm %x17|StatsByAlt_Terrain %x18|Double_Terrain %x19|Shattered_hTerrain %x20|vlhTerrain %x21"
@@ -318,14 +347,17 @@
 	global fileinfo, filemessage
 	global iScale, Offset, Invert, NSize, Sx, Sy, Lx, Ly, WorldSpaceCo
 	global NType, Basis, musgr, vlnoi, vlnoiTwo, voron, turbOne, turbTwo, marbleOne, marbleTwo, tBasismod, musgrTwo
-	global CustomFX, effect_image, Effect_Ctrl, Min, Max, Falloff, CustomFilt, Filter_Mode, Def_Filter_Ctrl, Ipo_Filter_Ctrl, Filter_Order
-	global RandMod, RSeed, rand_H, rand_S, rand_L, rand_I, AutoUpd, PreView, DefaultIpoName
+	global CustomFX, effect_image, Effect_Ctrl, Min, Max, Falloff, CustomFilt, Filter_Mode, Def_Filter_Ctrl, Ipo_Filter_Ctrl, Filter_Order, Erosion
+	global RandMod, RSeed, rand_H, rand_S, rand_L, rand_I, AutoUpd, PreView, DefaultIpoName, selLimit
 
 	filemessage = ''
 	fileinfo    = ''
 	effect_image = 'Load and Select image.'
 	AutoUpd  = Create( 0 )
 	PreView = [ Create( 0 ), Create( 1.0 ), Create( 0.0 ) ]
+
+	selLimit= Create( 0.96 )
+
 	## Coords controls:
 	WorldSpaceCo = Create(0)
 	iScale = [ Create( 1.0 ), Create( 1.0 ), Create( 0.25) ]
@@ -337,7 +369,7 @@
 	Lx = [ Create( 0.0 ), Create( 0.0 ) ]
 	Ly = [ Create( 0.0 ), Create( 0.0 ) ]
 	## Noise controls:
-	NType = Create( 3 )
+	NType = Create( 20 )
 	Basis = [ Create( 0 ), Create( 0 ) ]
 	musgr = [ Create( 1.0 ), Create( 2.0 ), Create( 8 ), Create( 1.0 ), Create( 1.0 ), Create( 0.5 ) ]
 	vlnoi = [ Create( 1.0 ), Create( 0 ) ]
@@ -361,6 +393,10 @@
 	Ipo_Filter_Ctrl = [ Create( DefaultIpoName ), Create( 0 ), Create( 100.0 ), Create( 100.0 ) ]
 	Filter_Order =  Create( 0 )
 	CustomFilt = [ Create('sqrt(h*h)**2'), Create('0'), Create('a') ]
+
+	Erosion = [ Create( 0 ), Create( 1 ), Create( 2 ), Create( 2.5 ) ]
+
+
 	## Randomise noise buttons:
 	RandMod = Create( 1 )
 	RSeed   = Create( 0 )
@@ -577,20 +613,32 @@
 #
 def FilterButtons( col, row, width, height ):
 	global iScale, Offset, Invert, Min, Max, Falloff, CustomFilt
-	global Filter_Mode, Def_Filter_Ctrl, Ipo_Filter_Ctrl, DefaultIpoName, Filter_Order
+	global Filter_Mode, Def_Filter_Ctrl, Ipo_Filter_Ctrl, DefaultIpoName, Filter_Order, Erosion
 
 	iScale[2] = Number("Height:", Btn_Evt, col[5], row[2], width[3], height[2], iScale[2].val,   -10.0, 10.0 , "Terrain Height:  Scale" )
 	Invert[2] = Toggle("Inv.",    Btn_Evt, col[9], row[2], width[0], height[2], Invert[2].val, "Terrain Height:  Invert")
 	Offset[2] = Number("Offset:", Btn_Evt, col[5], row[3], width[4], height[1], Offset[2].val,   -10.0, 10.0 , "Terrain Height:  Offset" )
-	Max = Number(    "Plateau:",  Btn_Evt, col[5], row[5], width[4], height[1], Max.val, Min.val, 1.0 , "Terrain Height:  Clamp Max. ( Plateau )" )
-	Min = Number(    "Sealevel:", Btn_Evt, col[5], row[6], width[4], height[1], Min.val, -1.0, Max.val , "Terrain Height:  Clamp Min. ( Sealevel )" )
-	Falloff[0] = Menu( falloftypemenu, Btn_Evt ,col[5], row[9], width[4], height[2], Falloff[0].val, "Terrain Height:  Edge falloff")
+	Max = Number(    "Plateau:",  Btn_Evt, col[5], row[4], width[4], height[1], Max.val, Min.val, 1.0 , "Terrain Height:  Clamp Max. ( Plateau )" )
+	Min = Number(    "Sealevel:", Btn_Evt, col[5], row[5], width[4], height[1], Min.val, -1.0, Max.val , "Terrain Height:  Clamp Min. ( Sealevel )" )
+
+	Falloff[0] = Menu( falloftypemenu, Btn_Evt ,col[5], row[7], width[4], height[1], Falloff[0].val, "Terrain Height:  Edge falloff")
 	if Falloff[0].val !=0:
-		Falloff[1] = Number("X:",   Btn_Evt, col[5], row[10], width[1], height[1], Falloff[1].val , 0.01, 100.0 , "Edge falloff:  X Size" )		
-		Falloff[2] = Number("Y:",   Btn_Evt, col[8], row[10], width[1], height[1], Falloff[2].val , 0.01, 100.0 , "Edge falloff:  Y Size" )
-		Falloff[4] = Toggle("Inv.", Btn_Evt, col[7], row[10], width[0], height[1], Falloff[4].val, "Edge falloff:  Invert")
-		Falloff[3] = Toggle("Edge At Sealevel", Btn_Evt, col[5], row[7], width[4], height[1], Falloff[3].val, "Edge falloff:  Edge at Sealevel")
+		Falloff[1] = Number("X:",   Btn_Evt, col[5], row[8], width[1], height[1], Falloff[1].val , 0.01, 100.0 , "Edge falloff:  X Size" )		
+		Falloff[2] = Number("Y:",   Btn_Evt, col[8], row[8], width[1], height[1], Falloff[2].val , 0.01, 100.0 , "Edge falloff:  Y Size" )
+		Falloff[4] = Toggle("Inv.", Btn_Evt, col[7], row[8], width[0], height[1], Falloff[4].val, "Edge falloff:  Invert")
+		Falloff[3] = Toggle("Edge At Sealevel", Btn_Evt, col[5], row[6], width[4], height[1], Falloff[3].val, "Edge falloff:  Edge at Sealevel")
 
+
+	##########
+	Erosion[0] = Toggle("ThemalErosion", Btn_Evt, col[5], row[9], width[2], height[1], Erosion[0].val, "Thermal Erosion")
+	if Erosion[0].val !=0:
+		neighbormenu = "Neighborhood %t|Moore %x0|Neumann %x1|Inv. Neumann %x2"
+		Erosion[1] = Menu( neighbormenu, Btn_Evt ,col[5], row[10], width[1], height[1], Erosion[1].val, "Neighborhood calculation type")
+		Erosion[2] = Number("Passes:",   Btn_Evt, col[8],  row[9], width[1], height[1], Erosion[2].val , 1,   100,   "Number of erosion passes" )		
+		Erosion[3] = Number("Factor:",   Btn_Evt, col[7], row[10], width[2], height[1], Erosion[3].val , 0.01,100.0, "Erosion factor amount" )
+
+
+
 	Filter_Mode = Menu( filtermodemenu,               No_Evt, col[0], row[2], width[4], height[2], Filter_Mode.val, "Filter:  Mode")
 	if Filter_Mode.val ==1:
 		Def_Filter_Ctrl[0] = Menu( filtertypemenu,     Btn_Evt, col[0], row[5], width[4], height[2], Def_Filter_Ctrl[0].val, "Filter:  Type")
@@ -615,11 +663,13 @@
 	if Filter_Mode.val !=0:
 		Filter_Order = Toggle("Change Filter Order",   Btn_Evt, col[0], row[3], width[4], height[1], Filter_Order.val, "Filter Order: OFF = Noise+Effect+Falloff+FILTER / ON = Noise+FILTER+Effect+Falloff.")
 
+
+
 ###-------------------------
-## Option / Generate Image Buttons:
+## Options / Generate Image Buttons:
 #
 def OptionButtons( col, row, width, height ):
-	global PreView, previewname
+	global PreView, previewname, selLimit
 
 	PreView[0] = Toggle("Make Image", No_Evt, col[0], row[2], width[4], height[2], PreView[0].val, "Image: On/Off (Make a new Image in UV/ImageEditor Window, and give a name to it)")
 	if PreView[0].val !=0:
@@ -632,12 +682,28 @@
 		draw_Text( ( col[5], row[3] ), 'give it a name,', black, 0 )
 		draw_Text( ( col[5], row[4] ), 'and save it manualy.', black, 0 )
 
+	
+
+	PushButton( "Slope Select Vertices",  VSel_Evt, col[0], row[9], width[4], height[1] , "Select Vertices by slope (MeshEditMode) ")
+	PushButton( "Slope Select Faces",  FSel_Evt, col[5], row[9], width[4], height[1] , "Select Faces by slope (MeshEditMode) ")
+	selLimit = Slider("Slope Selection Limit ",     No_Evt, col[0], row[10], width[9], height[1], selLimit.val, 0.0, 1.0, 0, "Vertice/Face selection limit")
+	PushButton( "Generate VertexColour Slope Map",  VCol_Evt, col[0], row[8], width[9], height[1] , "Make vertex colour slope map (MeshVertexPaintMode) (Use with MaterialNodes) ")
+
+
+
+
+
+
+
+
+
+
 ####--------------------------------------------------------------------------
 ###--------------------------------------------------------------------------
 ## Draw G.U.I. -------------------------------------------------------------
 #--------------------------------------------------------------------------
 def drawgui():
-	global guitabs, ledcolor, FullScreen, AutoUpd, RandMod, RSeed, filemessage

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list