[Bf-blender-cvs] [1ec2905c07c] temp-wm-event-api: Test for texture paint
Campbell Barton
noreply at git.blender.org
Wed Jan 30 14:23:06 CET 2019
Commit: 1ec2905c07c22a2bc6ecfcf03d9702c9b15efa73
Author: Campbell Barton
Date: Thu Jan 31 00:24:17 2019 +1100
Branches: temp-wm-event-api
https://developer.blender.org/rB1ec2905c07c22a2bc6ecfcf03d9702c9b15efa73
Test for texture paint
===================================================================
A tests/python/event_simulate/view3d_mesh_texpaint_undo.py
===================================================================
diff --git a/tests/python/event_simulate/view3d_mesh_texpaint_undo.py b/tests/python/event_simulate/view3d_mesh_texpaint_undo.py
new file mode 100644
index 00000000000..9310162a373
--- /dev/null
+++ b/tests/python/event_simulate/view3d_mesh_texpaint_undo.py
@@ -0,0 +1,51 @@
+# Apache License, Version 2.0
+# ./blender.bin --debug-events-simulate --python tests/python/event_simulate/view3d_mesh_texpaint_undo.py
+
+import os
+import sys
+sys.path.append(os.path.join(os.path.dirname(__file__), "modules"))
+
+import easy_keys
+
+# Callback doesn't have context.
+import bpy
+from bpy import context
+window = context.window
+context.preferences.view.smooth_view = 0
+
+def play_keys():
+ e = easy_keys.EventGenerate(window)
+
+ size = window.width, window.height
+
+ yield e.esc() # Kick splash screen away
+ yield e.shift.f5() # 3D View
+ yield e.ctrl.space() # Full-screen.
+ yield e.a().x().ret() # Delete all.
+ yield e.shift.a().m().m() # Add monkey.
+ yield e.numpad_period() # View monkey
+ yield e.ctrl.tab().t() # Paint via pie menu.
+ yield e.f3() # Paint slot via search.
+
+ # Second ret to accept the dialog.
+ yield e.text("Add Texture Paint Slot").ret().ret()
+
+ yield from e.leftmouse.cursor_motion(
+ (x, size[1] // 2) for x in
+ range(int(size[0] * 0.2), int(size[0] * 0.8), 80)
+ )
+ yield e.ctrl.z() # OK,
+ yield e.ctrl.shift.z() # OK,
+
+ yield e.ctrl.z() # OK
+ yield e.ctrl.z() # OK
+ yield e.ctrl.shift.z() # OK
+ yield e.ctrl.shift.z() # Not OK, stays pink.
+
+ # Note, undo tiles also report unfreed, needs fixing.
+
+ # Allow human interaction.
+ bpy.app.debug_events_simulate = False
+ yield False
+
+easy_keys.run(play_keys())
More information about the Bf-blender-cvs
mailing list