[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53519] trunk/blender/release/scripts/ startup/bl_operators/vertexpaint_dirt.py: fix [#33715] Dirty Vertex Colors display problem since 2.65a
Campbell Barton
ideasman42 at gmail.com
Thu Jan 3 08:01:47 CET 2013
Revision: 53519
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53519
Author: campbellbarton
Date: 2013-01-03 07:01:41 +0000 (Thu, 03 Jan 2013)
Log Message:
-----------
fix [#33715] Dirty Vertex Colors display problem since 2.65a
Modified Paths:
--------------
trunk/blender/release/scripts/startup/bl_operators/vertexpaint_dirt.py
Modified: trunk/blender/release/scripts/startup/bl_operators/vertexpaint_dirt.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/vertexpaint_dirt.py 2013-01-03 06:47:44 UTC (rev 53518)
+++ trunk/blender/release/scripts/startup/bl_operators/vertexpaint_dirt.py 2013-01-03 07:01:41 UTC (rev 53519)
@@ -127,13 +127,14 @@
col[0] = tone * col[0]
col[1] = tone * col[1]
col[2] = tone * col[2]
-
+ me.update()
return {'FINISHED'}
import bpy
from bpy.types import Operator
from bpy.props import FloatProperty, IntProperty, BoolProperty
+from math import pi
class VertexPaintDirt(Operator):
@@ -156,14 +157,16 @@
clean_angle = FloatProperty(
name="Highlight Angle",
description="Less than 90 limits the angle used in the tonal range",
- min=0.0, max=180.0,
- default=180.0,
+ min=0.0, max=pi,
+ default=pi,
+ unit="ROTATION",
)
dirt_angle = FloatProperty(
name="Dirt Angle",
description="Less than 90 limits the angle used in the tonal range",
- min=0.0, max=180.0,
+ min=0.0, max=pi,
default=0.0,
+ unit="ROTATION",
)
dirt_only = BoolProperty(
name="Dirt Only",
@@ -171,20 +174,21 @@
default=False,
)
+ @classmethod
+ def poll(cls, context):
+ obj = context.object
+ return (obj and obj.type == 'MESH')
+
def execute(self, context):
import time
from math import radians
+
obj = context.object
-
- if not obj or obj.type != 'MESH':
- self.report({'ERROR'}, "Error, no active mesh object, aborting")
- return {'CANCELLED'}
-
mesh = obj.data
t = time.time()
- ret = applyVertexDirt(mesh, self.blur_iterations, self.blur_strength, radians(self.dirt_angle), radians(self.clean_angle), self.dirt_only)
+ ret = applyVertexDirt(mesh, self.blur_iterations, self.blur_strength, self.dirt_angle, self.clean_angle, self.dirt_only)
print('Dirt calculated in %.6f' % (time.time() - t))
More information about the Bf-blender-cvs
mailing list