[Bf-extensions-cvs] [4291478] master: Deleted the 'meadown' addon.
Lukas Tönne
noreply at git.blender.org
Mon Jun 22 11:36:12 CEST 2015
Commit: 429147806f652b804a2f29a671eccaec281d23c7
Author: Lukas Tönne
Date: Mon Jun 22 11:35:17 2015 +0200
Branches: master
https://developer.blender.org/rBAC429147806f652b804a2f29a671eccaec281d23c7
Deleted the 'meadown' addon.
This was an experimental part of the Gooseberry project, but broken now
and unmaintained.
===================================================================
D object_physics_meadow/__init__.py
D object_physics_meadow/best_candidate.py
D object_physics_meadow/blob.py
D object_physics_meadow/duplimesh.py
D object_physics_meadow/dupliparticle.py
D object_physics_meadow/hierarchical_dart_throw.py
D object_physics_meadow/meadow.py
D object_physics_meadow/patch.py
D object_physics_meadow/physics.py
D object_physics_meadow/pointcache.py
D object_physics_meadow/progress.py
D object_physics_meadow/settings.py
D object_physics_meadow/ui.py
D object_physics_meadow/util.py
===================================================================
diff --git a/object_physics_meadow/__init__.py b/object_physics_meadow/__init__.py
deleted file mode 100644
index 2b92d2d..0000000
--- a/object_physics_meadow/__init__.py
+++ /dev/null
@@ -1,43 +0,0 @@
-### BEGIN GPL LICENSE BLOCK #####
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
- "name": "Meadow",
- "author": "Lukas Toenne",
- "version": (0, 1, 0),
- "blender": (2, 7, 2),
- "location": "Scene Properties",
- "description": "Efficient large-scale grass simulation",
- "warning": "",
- "category": "Development"}
-
-import bpy
-from object_physics_meadow import settings, ui
-
-def register():
- settings.register()
- ui.register()
-
-def unregister():
- settings.unregister()
- ui.unregister()
-
-if __name__ == "__main__":
- register()
diff --git a/object_physics_meadow/best_candidate.py b/object_physics_meadow/best_candidate.py
deleted file mode 100644
index 659f202..0000000
--- a/object_physics_meadow/best_candidate.py
+++ /dev/null
@@ -1,70 +0,0 @@
-### BEGIN GPL LICENSE BLOCK #####
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-from math import *
-from mathutils import *
-from mathutils.kdtree import KDTree
-import random
-
-# simple uniform distribution for testing
-def uniform_2D(num, seed, xmin, xmax, ymin, ymax, radius):
- for i in range(num):
- yield (random.uniform(xmin, xmax), random.uniform(ymin, ymax))
-
-# Mitchell's best candidate algorithm
-def best_candidate_gen(radius, xmin, xmax, ymin, ymax):
- def best_candidate(k, tree):
- best_dist = radius * 2.0
- best = None
-
- for i in range(k):
- candidate = (random.uniform(xmin, xmax), random.uniform(ymin, ymax))
-
- npoint, nindex, ndist = tree.find((candidate[0], candidate[1], 0.0))
- if not nindex:
- return (random.uniform(xmin, xmax), random.uniform(ymin, ymax))
-
- if ndist > best_dist:
- best_dist = ndist
- best = candidate
-
- return best
-
- num_candidates = 10
-
- def gen(seed, num):
- random.seed(seed)
-
- data = []
- tree = KDTree(0)
- tree.balance()
- for i in range(num):
- best = best_candidate(num_candidates, tree)
- if not best:
- break
- yield best
-
- data.append((best[0], best[1], 0.0))
- tree = KDTree(len(data))
- for i, p in enumerate(data):
- tree.insert(p, i)
- tree.balance()
-
- return gen
diff --git a/object_physics_meadow/blob.py b/object_physics_meadow/blob.py
deleted file mode 100644
index 59752c5..0000000
--- a/object_physics_meadow/blob.py
+++ /dev/null
@@ -1,403 +0,0 @@
-### BEGIN GPL LICENSE BLOCK #####
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-import bpy
-from bpy_extras import object_utils
-from math import *
-from mathutils import *
-from mathutils.kdtree import KDTree
-from mathutils.interpolate import poly_3d_calc
-from itertools import accumulate
-import random
-
-from object_physics_meadow import settings as _settings
-from object_physics_meadow import duplimesh
-from object_physics_meadow.duplimesh import project_on_ground
-from object_physics_meadow.util import *
-from object_physics_meadow import progress
-
-_blob_object_name = "__MeadowBlob__"
-_sampleviz_parent_name = "Meadow_SampleViz_Root"
-_duplicator_parent_name = "Meadow_Duplicators_Root"
-
-def blob_objects(context):
- settings = _settings.get(context)
- blob_group = settings.blob_group(context)
- # ignore objects with invalid blob index
- return [ob for ob in blob_group.objects if ob.meadow.blob_index >= 0]
-
-def blob_group_clear(context):
- settings = _settings.get(context)
- blob_group = settings.blob_group(context)
-
- if blob_group:
- delete_objects(context, blob_group.objects)
-
-def blob_group_assign(context, blobob, test=False):
- settings = _settings.get(context)
- blob_group = settings.blob_group(context)
-
- if test and blobob in blob_group.objects.values():
- return
-
- blob_group.objects.link(blobob)
- # NOTE: unsetting the type is important, otherwise gathering templates
- # a second time will include deleted objects!
- blobob.meadow.type = 'NONE'
-
-def blob_group_remove(context, blobob):
- settings = _settings.get(context)
- blob_group = settings.blob_group(context)
-
- blob_group.objects.unlink(blobob)
-
-def blob_apply_settings(ob, settings):
- pass # TODO
-
-#-----------------------------------------------------------------------
-
-# 8-class qualitative Brewer color scheme for high-contrast colors
-# http://colorbrewer2.org/
-color_schemes = [
- (228, 26, 28),
- (55, 126, 184),
- (77, 175, 74),
- (152, 78, 163),
- (255, 127, 0),
- (255, 255, 51),
- (166, 86, 40),
- (247, 129, 191),
- ]
-
-def select_color(index):
- base = color_schemes[hash(str(index)) % len(color_schemes)]
- return (base[0]/255.0, base[1]/255.0, base[2]/255.0, 1.0)
-
-def get_blob_material(context):
- materials = context.blend_data.materials
- if _blob_object_name in materials:
- return materials[_blob_object_name]
-
- # setup new blob material
- ma = materials.new(_blob_object_name)
- ma.use_object_color = True
- # make the material stand out a bit more using emission
- ma.emit = 1.0
- return ma
-
-def get_blob_parent(context, obmat, name):
- ob = context.blend_data.objects.get(name, None)
- if not ob:
- ob = object_utils.object_data_add(bpy.context, None, name=name).object
- # put it in the blob group
- blob_group_assign(context, ob, test=True)
-
- ob.matrix_world = obmat
-
- return ob
-
-# assign sample to a blob, based on distance weighting
-def assign_blob(blobtree, loc, nor):
- num_nearest = 4 # number of blobs to consider
-
- nearest = blobtree.find_n(loc, num_nearest)
-
- totn = len(nearest)
- if totn == 0:
- return -1
- if totn == 1:
- return nearest[0][1]
- totdist = fsum(dist for co, index, dist in nearest)
- if totdist == 0.0:
- return -1
-
- norm = 1.0 / (float(totn-1) * totdist)
- accum = list(accumulate(((totdist - dist) * norm) ** 8 for co, index, dist in nearest))
-
- u = random.uniform(0.0, accum[-1])
- for a, (co, index, dist) in zip(accum, nearest):
- if u < a:
- return index
- return -1
-
-def make_blob_object(context, index, loc, samples, display_radius):
- settings = _settings.get(context)
-
- obmat = Matrix.Translation(loc)
-
- mesh = duplimesh.make_dupli_mesh(_blob_object_name, obmat, samples, display_radius)
- mesh.materials.append(get_blob_material(context))
-
- ob = object_utils.object_data_add(bpy.context, mesh, operator=None).object
- # assign the index for mapping
- ob.meadow.blob_index = index
- # objects get put at the cursor location by object_utils
- ob.matrix_world = obmat
-
- blob_apply_settings(ob, settings)
-
- # assign color and material settings
- ob.color = select_color(index)
- ob.show_wire_color = True # XXX this is debatable, could make it an option
-
- return ob
-
-class Blob():
- def __init__(self, loc, nor, poly_index):
- self.loc = loc
- self.nor = nor
- self.poly_index = poly_index
- self.samples = []
-
- def add_sample(self, loc, nor, poly, verts, weights):
- self.samples.append((loc, nor, poly, verts, weights))
-
- # note: Vector instances cannot be pickled directly,
- # therefore define own pickle methods here
- def __getstate__(self):
- return self.loc[:], self.nor[:], self.poly_index, [(sloc[:], snor[:], spoly, sverts, sweights) for sloc, snor, spoly, sverts, sweights in self.samples]
-
- def __setstate__(self, state):
- self.lo
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list