[Bf-blender-cvs] [a34cad2] temp-sybren-poselib: "Fix" desapearing previews issue.
Bastien Montagne
noreply at git.blender.org
Tue Nov 1 18:29:22 CET 2016
Commit: a34cad20061bd05ca39de428cf00c5a06a5be3f5
Author: Bastien Montagne
Date: Tue Nov 1 18:28:15 2016 +0100
Branches: temp-sybren-poselib
https://developer.blender.org/rBa34cad20061bd05ca39de428cf00c5a06a5be3f5
"Fix" desapearing previews issue.
More like a hack than anything else, need to figure out the correct way
to do that yet (in an efficient way), have the feeling a function would
work better somehow...
===================================================================
M release/scripts/startup/bl_operators/poselib.py
M release/scripts/startup/bl_ui/properties_data_armature.py
===================================================================
diff --git a/release/scripts/startup/bl_operators/poselib.py b/release/scripts/startup/bl_operators/poselib.py
index c7c1184..19ab616 100644
--- a/release/scripts/startup/bl_operators/poselib.py
+++ b/release/scripts/startup/bl_operators/poselib.py
@@ -116,10 +116,12 @@ class POSELIB_OT_render_previews(Operator):
fname = os.path.join(plib.pose_previews_dir, '%s.png' % marker.name)
bpy.data.images['Render Result'].save_render(bpy.path.abspath(fname))
im = bpy.data.images.load(fname)
- im.scale(128, 128)
+ im.scale(16, 16)
marker.preview_frame_index = plib_index
- plib.preview.image_frames_float[plib_index][:] = im.pixels
- plib.preview.icon_frames_float[plib_index][:] = im.pixels
+ pix = [list(f) for f in plib.preview.image_frames_float]
+ pix[plib_index][:] = im.pixels
+ plib.preview.image_frames_float[:] = pix
+ plib.preview.icon_frames_float[:] = pix
def invoke(self, context, event):
wm = context.window_manager
@@ -130,7 +132,7 @@ class POSELIB_OT_render_previews(Operator):
self.plib_index = 0
plib = context.object.pose_library
- plib.preview.icon_size = plib.preview.image_size = (128, 128)
+ plib.preview.icon_size = plib.preview.image_size = (16, 16)
plib.preview.frames_number = len(plib.pose_markers)
for pmrk in plib.pose_markers:
pmrk.preview_frame_index = 0
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index e8ca99d..0921fec 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -269,7 +269,7 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
for marker in poselib.pose_markers:
col.label(marker.name, icon_value=poselib.preview.icon_id, icon_frame=marker.preview_frame_index)
- layout.template_icon_view(poselib, 'pose_previews', show_labels=True)
+ #~ layout.template_icon_view(poselib, 'pose_previews', show_labels=True)
layout.prop(poselib, "pose_previews_dir")
col.operator_context = 'INVOKE_DEFAULT'
More information about the Bf-blender-cvs
mailing list