[Bf-extensions-cvs] [e42f371] master: Scale the faces in blob objects to the patch radius to make them more visible at great distances.

Lukas Tönne noreply at git.blender.org
Tue Dec 9 19:55:24 CET 2014


Commit: e42f371aa4eb18975c4d5ab3587dfe7cb2fec389
Author: Lukas Tönne
Date:   Tue Dec 9 14:45:41 2014 +0100
Branches: master
https://developer.blender.org/rBACe42f371aa4eb18975c4d5ab3587dfe7cb2fec389

Scale the faces in blob objects to the patch radius to make them more
visible at great distances.

===================================================================

M	object_physics_meadow/blob.py
M	object_physics_meadow/duplimesh.py

===================================================================

diff --git a/object_physics_meadow/blob.py b/object_physics_meadow/blob.py
index 9996091..8b65f3f 100644
--- a/object_physics_meadow/blob.py
+++ b/object_physics_meadow/blob.py
@@ -131,12 +131,12 @@ def assign_blob(blobtree, loc, nor):
             return index
     return -1
 
-def make_blob_object(context, index, loc, samples):
+def make_blob_object(context, index, loc, samples, radius):
     settings = _settings.get(context)
     
     obmat = Matrix.Translation(loc)
     
-    mesh = duplimesh.make_dupli_mesh(_blob_object_name, obmat, samples)
+    mesh = duplimesh.make_dupli_mesh(_blob_object_name, obmat, samples, radius)
     mesh.materials.append(get_blob_material(context))
     
     ob = object_utils.object_data_add(bpy.context, mesh, operator=None).object
@@ -176,7 +176,7 @@ def make_blobs(context, gridob, groundob, samples):
             blob_list[index][1].append((loc, nor))
     
     for index, (loc, samples) in enumerate(blob_list):
-        make_blob_object(context, index, loc, samples)
+        make_blob_object(context, index, loc, samples, gridob.meadow.patch_radius)
 
 #-----------------------------------------------------------------------
 
diff --git a/object_physics_meadow/duplimesh.py b/object_physics_meadow/duplimesh.py
index 2bf9fed..f4d81ba 100644
--- a/object_physics_meadow/duplimesh.py
+++ b/object_physics_meadow/duplimesh.py
@@ -38,10 +38,10 @@ def project_on_ground(groundob, co):
         return False, co, (0.0, 0.0, 1.0)
 
 
-def make_dupli_mesh(name, obmat, samples):
+def make_dupli_mesh(name, obmat, samples, scale):
     tot = len(samples)
     scalemat = Matrix()
-    scalemat[0][0] = scalemat[1][1] = scalemat[2][2] = 0.1
+    scalemat[0][0] = scalemat[1][1] = scalemat[2][2] = scale
     scalemat[3][3] = 1.0
     
     invobmat = obmat.inverted()



More information about the Bf-extensions-cvs mailing list