[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3136] contrib/py/scripts/addons/ space_view3d_paint_bprojection.py: space_view3d_paint_bprojection: improve intuitive scale to use the y axis, have to change the wiki
geo kgeo
kgeogeo at hotmail.com
Tue Mar 20 00:12:32 CET 2012
Revision: 3136
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3136
Author: kgeogeo
Date: 2012-03-19 23:12:28 +0000 (Mon, 19 Mar 2012)
Log Message:
-----------
space_view3d_paint_bprojection: improve intuitive scale to use the y axis, have to change the wiki
Modified Paths:
--------------
contrib/py/scripts/addons/space_view3d_paint_bprojection.py
Modified: contrib/py/scripts/addons/space_view3d_paint_bprojection.py
===================================================================
--- contrib/py/scripts/addons/space_view3d_paint_bprojection.py 2012-03-19 22:32:56 UTC (rev 3135)
+++ contrib/py/scripts/addons/space_view3d_paint_bprojection.py 2012-03-19 23:12:28 UTC (rev 3136)
@@ -253,17 +253,21 @@
"is_start":True, "location":(0, 0, 0),
"mouse":(x,y), "pressure":1, "time":0}])
else:
- if len(bpy.context.object.grease_pencil.layers.active.frames[0].strokes) < 4:
+ if len(bpy.context.object.grease_pencil.layers.active.frames[0].strokes) < 6:
bpy.ops.gpencil.draw(mode='DRAW', stroke=[{"name":"", "pen_flip":False,
"is_start":True, "location":(0, 0, 0),
"mouse":(x,y), "pressure":1, "time":0}])
- if len(bpy.context.object.grease_pencil.layers.active.frames[0].strokes) == 4:
+ if len(bpy.context.object.grease_pencil.layers.active.frames[0].strokes) == 6:
s = bpy.context.object.grease_pencil.layers.active.frames[0]
v1 = s.strokes[1].points[0].co - s.strokes[0].points[0].co
- v2 = s.strokes[3].points[0].co - s.strokes[2].points[0].co
- prop = v1.x/v2.x
- bpy.context.object.custom_scale[0] *= abs(prop)
- bpy.context.object.custom_scale[1] *= abs(prop)
+ v2 = s.strokes[4].points[0].co - s.strokes[3].points[0].co
+ propx = v1.x/v2.x
+ bpy.context.object.custom_scale[0] *= abs(propx)
+
+ v1 = s.strokes[2].points[0].co - s.strokes[0].points[0].co
+ v2 = s.strokes[5].points[0].co - s.strokes[3].points[0].co
+ propy = v1.y/v2.y
+ bpy.context.object.custom_scale[1] *= abs(propy)
bpy.ops.gpencil.active_frame_delete()
return {'FINISHED'}
More information about the Bf-extensions-cvs
mailing list