[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23359] trunk/blender/source/blender/ editors: 2.5 - Pose Relax/Push improvements

2009-09-19 Thread Joshua Leung
Revision: 23359
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23359
Author:   aligorith
Date: 2009-09-20 07:05:16 +0200 (Sun, 20 Sep 2009)

Log Message:
---
2.5 - Pose Relax/Push improvements

* Relax and Push are now interactive. Moving the mouse left<->right 
decreases/increases (respectively) the number of times the pose is relaxed or 
pushed. The sensitivity on this could be tweaked as necessary.

* Cancelling these 'pose sliding' tools now correctly restores the initial pose
* Autokeyframing is now only done when the operator is confirmed.

--

Also, made 'View persp/ortho' <-> 'View Persp/Ortho' to be more in line with 
other operator names, but to also make it easier to read.

Modified Paths:
--
trunk/blender/source/blender/editors/armature/poseSlide.c
trunk/blender/source/blender/editors/space_view3d/view3d_edit.c

Modified: trunk/blender/source/blender/editors/armature/poseSlide.c
===
--- trunk/blender/source/blender/editors/armature/poseSlide.c   2009-09-20 
01:36:11 UTC (rev 23358)
+++ trunk/blender/source/blender/editors/armature/poseSlide.c   2009-09-20 
05:05:16 UTC (rev 23359)
@@ -135,7 +135,13 @@

ListBase fcurves;   /* F-Curves for this PoseChannel */
bPoseChannel *pchan;/* Pose Channel which data is attached to */
+   
char *pchan_path;   /* RNA Path to this Pose Channel (needs 
to be freed when we're done) */
+   
+   float oldloc[3];/* transform values at start of 
operator (to be restored before each modal step) */
+   float oldrot[3];
+   float oldscale[3];
+   float oldquat[4];
 } tPChanFCurveLink;
 
 /*  */
@@ -202,6 +208,12 @@
pchan->flag |= POSE_ROT;
if (transFlags & ACT_TRANS_SCALE)
pchan->flag |= POSE_SIZE;
+   
+   /* store current transforms */
+   VECCOPY(pfl->oldloc, pchan->loc);
+   VECCOPY(pfl->oldrot, pchan->eul);
+   VECCOPY(pfl->oldscale, pchan->size);
+   QUATCOPY(pfl->oldquat, pchan->quat);
}
}
CTX_DATA_END;
@@ -261,6 +273,23 @@
 
 /*  */
 
+/* helper for apply() / reset() - refresh the data */
+static void pose_slide_refresh (bContext *C, tPoseSlideOp *pso)
+{
+   /* old optimize trick... this enforces to bypass the depgraph 
+*  - note: code copied from transform_generics.c -> recalcData()
+*/
+   // FIXME: shouldn't this use the builtin stuff?
+   if ((pso->arm->flag & ARM_DELAYDEFORM)==0)
+   DAG_id_flush_update(&pso->ob->id, OB_RECALC_DATA);  /* sets 
recalc flags */
+   else
+   where_is_pose(pso->scene, pso->ob);
+   
+   /* note, notifier might evolve */
+   WM_event_add_notifier(C, NC_OBJECT|ND_POSE, pso->ob);
+   WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); 
+}
+
 /* helper for apply() callabcks - find the next F-Curve with matching path... 
*/
 static LinkData *find_next_fcurve_link (ListBase *fcuLinks, LinkData *prev, 
char *path)
 {
@@ -330,22 +359,45 @@
w2 = (w2/wtot);
}

-   /* depending on the mode, */
+   /* depending on the mode, calculate the new value
+*  - in all of these, the start+end values are multiplied 
by w2 and w1 (respectively),
+*since multiplication in another order would decrease 
the value the current frame is closer to
+*/
switch (pso->mode) {
case POSESLIDE_PUSH: /* make the current pose more 
pronounced */
-   // TODO: this is not interactively modifiable!
-   vec[ch]= ( -((sVal * w2) + (eVal * w1)) + 
(vec[ch] * 6.0f) ) / 5.0f;
+   {
+   /* perform a weighted average here, favouring 
the middle pose 
+*  - numerator should be larger than 
denominator to 'expand' the result
+*  - perform this weighting a number of 
times given by the percentage...
+*/
+   int iters= (int)ceil(10.0f*pso->percentage); // 
TODO: maybe a sensitivity ctrl on top of this is needed
+   
+   while (iters-- > 0) {
+   vec[ch]= ( -((sVal * w2) + (eVal * w1)) 
+ (vec[ch] * 6.0f) ) / 5.0f; 
+   }
+   }
break;
  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23358] trunk/blender/source/blender/ editors: 2.5 - 2 Armature Related Crash Fixes

2009-09-19 Thread Joshua Leung
Revision: 23358
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23358
Author:   aligorith
Date: 2009-09-20 03:36:11 +0200 (Sun, 20 Sep 2009)

Log Message:
---
2.5 - 2 Armature Related Crash Fixes

* #19397: Properties panel (transform panel in 3D-View) crashed when there was 
no active posechannel. 

* Breakdown/Push/Relax Pose tools crashed when auto-keyframing was enabled. 
There where 2 main causes here: 1) laziness to try and avoid having to clear 
some data everytime, 2) a typo for one of the KeyingSet names

Modified Paths:
--
trunk/blender/source/blender/editors/armature/poseSlide.c
trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c

Modified: trunk/blender/source/blender/editors/armature/poseSlide.c
===
--- trunk/blender/source/blender/editors/armature/poseSlide.c   2009-09-19 
22:11:26 UTC (rev 23357)
+++ trunk/blender/source/blender/editors/armature/poseSlide.c   2009-09-20 
01:36:11 UTC (rev 23358)
@@ -219,7 +219,7 @@
/* get builtin KeyingSets */
pso->ks_loc= ANIM_builtin_keyingset_get_named(NULL, "Location");
pso->ks_rot= ANIM_builtin_keyingset_get_named(NULL, "Rotation");
-   pso->ks_scale= ANIM_builtin_keyingset_get_named(NULL, "Scale");
+   pso->ks_scale= ANIM_builtin_keyingset_get_named(NULL, "Scaling");

/* return status is whether we've got all the data we were requested to 
get */
return 1;
@@ -393,8 +393,7 @@
ListBase dsources = {&cks, &cks};

/* init common-key-source for use by KeyingSets */
-   // TODO: for now, we don't clear it out, since it should be 
safe to do so...
-   //memset(&cks, 0, sizeof(bCommonKeySrc));
+   memset(&cks, 0, sizeof(bCommonKeySrc));
cks.id= &pso->ob->id;

/* init cks for this PoseChannel, then use the relative 
KeyingSets to keyframe it */

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c
===
--- trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c  
2009-09-19 22:11:26 UTC (rev 23357)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c  
2009-09-20 01:36:11 UTC (rev 23358)
@@ -512,6 +512,10 @@
if(bone && (bone->flag & BONE_ACTIVE) && (bone->layer & 
arm->layer))
break;
}
+   if (!pchan) {
+   uiDefBut(block, LABEL, 0, "No Bone Active", 
0, 240, 100, 20, 0, 0, 0, 0, 0, "");
+   return; 
+   }

if (pchan->rotmode == PCHAN_ROT_AXISANGLE) {
float quat[4];
@@ -1447,25 +1451,12 @@
pt->draw= view3d_panel_transform_spaces;
BLI_addtail(&art->paneltypes, pt);
 
-   pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil");
-   strcpy(pt->idname, "VIEW3D_PT_gpencil");
-   strcpy(pt->label, "Greas Pencil");
-   pt->draw= view3d_panel_gpencil;
-   BLI_addtail(&art->paneltypes, pt);*/
-
pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel bonesketch 
spaces");
strcpy(pt->idname, "VIEW3D_PT_bonesketch_spaces");
strcpy(pt->label, "Bone Sketching");
pt->draw= view3d_panel_bonesketch_spaces;
pt->poll= view3d_panel_bonesketch_spaces_poll;
BLI_addtail(&art->paneltypes, pt);
-
-   /*
-   pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel redo");
-   strcpy(pt->idname, "VIEW3D_PT_redo");
-   strcpy(pt->label, "Last Operator");
-   pt->draw= view3d_panel_operator_redo;
-   BLI_addtail(&art->paneltypes, pt);
 */
// XXX view3d_panel_preview(C, ar, 0);
 }


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23357] trunk/blender/release/io/netrender : netrender: first draft for job balancer + some minor fixes

2009-09-19 Thread Martin Poirier
Revision: 23357
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23357
Author:   theeth
Date: 2009-09-20 00:11:26 +0200 (Sun, 20 Sep 2009)

Log Message:
---
netrender: first draft for job balancer + some minor fixes

Modified Paths:
--
trunk/blender/release/io/netrender/__init__.py
trunk/blender/release/io/netrender/client.py
trunk/blender/release/io/netrender/master.py
trunk/blender/release/io/netrender/model.py
trunk/blender/release/io/netrender/operators.py
trunk/blender/release/io/netrender/slave.py
trunk/blender/release/io/netrender/utils.py

Added Paths:
---
trunk/blender/release/io/netrender/balancing.py

Modified: trunk/blender/release/io/netrender/__init__.py
===
--- trunk/blender/release/io/netrender/__init__.py  2009-09-19 22:02:15 UTC 
(rev 23356)
+++ trunk/blender/release/io/netrender/__init__.py  2009-09-19 22:11:26 UTC 
(rev 23357)
@@ -6,6 +6,7 @@
 import slave
 import master
 import utils
+import balancing
 import ui
 
 # store temp data in bpy module

Added: trunk/blender/release/io/netrender/balancing.py
===
--- trunk/blender/release/io/netrender/balancing.py 
(rev 0)
+++ trunk/blender/release/io/netrender/balancing.py 2009-09-19 22:11:26 UTC 
(rev 23357)
@@ -0,0 +1,75 @@
+import time
+
+from netrender.utils import *
+import netrender.model
+
+class RatingRule:
+   def rate(self, job):
+   return 0
+
+class ExclusionRule:
+   def test(self, job):
+   return False
+
+class PriorityRule:
+   def test(self, job):
+   return False
+
+class Balancer:
+   def __init__(self):
+   self.rules = []
+   self.priorities = []
+   self.exceptions = []
+   
+   def addRule(self, rule):
+   self.rules.append(rule)
+   
+   def addPriority(self, priority):
+   self.priorities.append(priority)
+   
+   def addException(self, exception):
+   self.exceptions.append(exception)
+   
+   def applyRules(self, job):
+   return sum((rule.rate(job) for rule in self.rules))
+   
+   def applyPriorities(self, job):
+   for priority in self.priorities:
+   if priority.test(job):
+   return True # priorities are first
+   
+   return False
+   
+   def applyExceptions(self, job):
+   for exception in self.exceptions:
+   if exception.test(job):
+   return True # exceptions are last
+   
+   return False
+   
+   def sortKey(self, job):
+   return (1 if self.applyExceptions(job) else 0, # exceptions 
after
+   0 if self.applyPriorities(job) 
else 1, # priorities first
+   self.applyRules(job))
+   
+   def balance(self, jobs):
+   if jobs:
+   jobs.sort(key=self.sortKey)
+   return jobs[0]
+   else:
+   return None
+   
+# ==
+
+
+class RatingCredit(RatingRule):
+   def rate(self, job):
+   return -job.credits # more credit is better (sort at first in 
list)
+
+class NewJobPriority(PriorityRule):
+   def test(self, job):
+   return job.countFrames(status = DISPATCHED) == 0
+
+class ExcludeQueuedEmptyJob(ExclusionRule):
+   def test(self, job):
+   return job.status != JOB_QUEUED or job.countFrames(status = 
QUEUED) == 0


Property changes on: trunk/blender/release/io/netrender/balancing.py
___
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: trunk/blender/release/io/netrender/client.py
===
--- trunk/blender/release/io/netrender/client.py2009-09-19 22:02:15 UTC 
(rev 23356)
+++ trunk/blender/release/io/netrender/client.py2009-09-19 22:11:26 UTC 
(rev 23357)
@@ -103,7 +103,7 @@
job.priority = netsettings.priority

# try to send path first
-   conn.request("POST", "job", repr(job.serialize()))
+   conn.request("POST", "/job", repr(job.serialize()))
response = conn.getresponse()

job_id = response.getheader("job-id")
@@ -112,7 +112,7 @@
if response.status == http.client.ACCEPTED:
for filepath, start, end in job.files:
f = open(filepath, "rb")
-   conn.request("PUT", "file", f, headers={"job-id": 
job_id, "job-f

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23356] branches/soc-2008-mxcurioni/ release/scripts/freestyle/: Reverted all changes (i.e., deletion) in release/scripts/freestyle.

2009-09-19 Thread Tamito Kajiyama
Revision: 23356
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23356
Author:   kjym3
Date: 2009-09-20 00:02:15 +0200 (Sun, 20 Sep 2009)

Log Message:
---
Reverted all changes (i.e., deletion) in release/scripts/freestyle.

Added Paths:
---
branches/soc-2008-mxcurioni/release/scripts/freestyle/

Copied: branches/soc-2008-mxcurioni/release/scripts/freestyle (from rev 23340, 
branches/soc-2008-mxcurioni/release/scripts/freestyle)


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23355] trunk/blender: A few smaller adjustments to armature and bone properties.

2009-09-19 Thread William Reynish
Revision: 23355
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23355
Author:   billrey
Date: 2009-09-19 23:40:37 +0200 (Sat, 19 Sep 2009)

Log Message:
---
A few smaller adjustments to armature and bone properties.

Modified Paths:
--
trunk/blender/release/ui/buttons_data_armature.py
trunk/blender/release/ui/buttons_data_bone.py
trunk/blender/source/blender/makesrna/intern/rna_armature.c

Modified: trunk/blender/release/ui/buttons_data_armature.py
===
--- trunk/blender/release/ui/buttons_data_armature.py   2009-09-19 19:57:30 UTC 
(rev 23354)
+++ trunk/blender/release/ui/buttons_data_armature.py   2009-09-19 21:40:37 UTC 
(rev 23355)
@@ -37,7 +37,9 @@
ob = context.object
arm = context.armature
space = context.space_data
-
+   
+   layout.itemR(arm, "pose_position", expand=True)
+   
split = layout.split()
 
col = split.column()
@@ -50,7 +52,6 @@
col.itemR(arm, "auto_ik")

col = split.column()
-   col.itemR(arm, "rest_position")
col.itemL(text="Deform:")
col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
col.itemR(arm, "deform_envelope", text="Envelopes")
@@ -140,12 +141,16 @@
col.row().itemR(arm, "paths_location", expand=True)

col = split.column()
-   col.itemL(text="Show:")
+   col.itemL(text="Display:")
col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe 
Numbers")

-   layout.itemO("pose.paths_calculate")
+   layout.itemS()
+   
+   row = layout.row()
+   row.itemO("pose.paths_calculate", text="Calculate Paths")
+   row.itemO("pose.paths_clear", text="Clear Paths")
 
 class DATA_PT_ghost(DataButtonsPanel):
__label__ = "Ghost"
@@ -171,6 +176,7 @@
sub.itemR(arm, "ghost_size", text="Step")
 
col = split.column()
+   col.itemL(text="Display:")
col.itemR(arm, "ghost_only_selected", text="Selected Only")
 
 bpy.types.register(DATA_PT_context_arm)

Modified: trunk/blender/release/ui/buttons_data_bone.py
===
--- trunk/blender/release/ui/buttons_data_bone.py   2009-09-19 19:57:30 UTC 
(rev 23354)
+++ trunk/blender/release/ui/buttons_data_bone.py   2009-09-19 21:40:37 UTC 
(rev 23355)
@@ -177,7 +177,7 @@
split = layout.split(percentage=0.25)
split.itemR(pchan, "ik_dof_x", text="X")
row = split.row()
-   row.itemR(pchan, "ik_stiffness_x", text="Stiffness")
+   row.itemR(pchan, "ik_stiffness_x", text="Stiffness", 
slider=True)
row.active = pchan.ik_dof_x
 
split = layout.split(percentage=0.25)
@@ -192,7 +192,7 @@
split = layout.split(percentage=0.25)
split.itemR(pchan, "ik_dof_y", text="Y")
row = split.row()
-   row.itemR(pchan, "ik_stiffness_y", text="Stiffness")
+   row.itemR(pchan, "ik_stiffness_y", text="Stiffness", 
slider=True)
row.active = pchan.ik_dof_y
 
split = layout.split(percentage=0.25)
@@ -207,7 +207,7 @@
split = layout.split(percentage=0.25)
split.itemR(pchan, "ik_dof_z", text="Z")
row = split.row()
-   row.itemR(pchan, "ik_stiffness_z", text="Stiffness")
+   row.itemR(pchan, "ik_stiffness_z", text="Stiffness", 
slider=True)
row.active = pchan.ik_dof_z
 
split = layout.split(percentage=0.25)
@@ -220,7 +220,7 @@
row.active = pchan.ik_dof_z and pchan.ik_limit_z
 
split = layout.split()
-   split.itemR(pchan, "ik_stretch", text="Stretch")
+   split.itemR(pchan, "ik_stretch", text="Stretch", slider=True)
split.itemL()
 
 class BONE_PT_deform(BoneButtonsPanel):

Modified: trunk/blender/source/blender/makesrna/intern/rna_armature.c
===
--- trunk/blender/source/blender/makesrna/intern/rna_armature.c 2009-09-19 
19:57:30 UTC (rev 23354)
+++ trunk/blender/source/blender/makesrna/intern/rna_armature.c 2009-09-19 
21:40:37 UTC (rev 23355)
@@ -540,11 +540,14 @@
{ARM_PATH_ACFRA, "CURRENT_FRAME", 0, "Around Frame", "Display 
Paths of poses within a fixed number of frames around the current frame.

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23354] trunk/blender/source/blender: More Nodes wrapped to Layout Engine:

2009-09-19 Thread Thomas Dinges
Revision: 23354
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23354
Author:   dingto
Date: 2009-09-19 21:57:30 +0200 (Sat, 19 Sep 2009)

Log Message:
---
More Nodes wrapped to Layout Engine:

* Map Value, Alpha Over, Hue Saturation, Dilate/Erode
* RNA fixes and additions. 

Modified Paths:
--
trunk/blender/source/blender/editors/space_node/drawnode.c
trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
trunk/blender/source/blender/makesrna/intern/rna_nodetree_types.h

Modified: trunk/blender/source/blender/editors/space_node/drawnode.c
===
--- trunk/blender/source/blender/editors/space_node/drawnode.c  2009-09-19 
19:40:38 UTC (rev 23353)
+++ trunk/blender/source/blender/editors/space_node/drawnode.c  2009-09-19 
19:57:30 UTC (rev 23354)
@@ -1348,72 +1348,49 @@
 
 static void node_composit_buts_map_value(uiLayout *layout, PointerRNA *ptr)
 {
-   uiBlock *block= uiLayoutFreeBlock(layout);
-   bNode *node= ptr->data;
-   rctf *butr= &node->butr;
-   TexMapping *texmap= node->storage;
-   short xstart= (short)butr->xmin;
-   short dy= (short)(butr->ymax-19.0f);
-   short dx= (short)(butr->xmax-butr->xmin)/2;
+   uiLayout *sub, *col;

-   uiBlockBeginAlign(block);
-   uiDefButF(block, NUM, B_NODE_EXEC, "Offs:", xstart, dy, 2*dx, 19, 
texmap->loc, -1000.0f, 1000.0f, 10, 2, "");
-   dy-= 19;
-   uiDefButF(block, NUM, B_NODE_EXEC, "Size:", xstart, dy, 2*dx, 19, 
texmap->size, -1000.0f, 1000.0f, 10, 3, "");
-   dy-= 23;
-   uiBlockBeginAlign(block);
-   uiDefButBitI(block, TOG, TEXMAP_CLIP_MIN, B_NODE_EXEC, "Min", xstart, 
dy, dx, 19, &texmap->flag, 0.0f, 0.0f, 0, 0, "");
-   uiDefButF(block, NUM, B_NODE_EXEC, "", xstart+dx, dy, dx, 19, 
texmap->min, -1000.0f, 1000.0f, 10, 2, "");
-   dy-= 19;
-   uiDefButBitI(block, TOG, TEXMAP_CLIP_MAX, B_NODE_EXEC, "Max", xstart, 
dy, dx, 19, &texmap->flag, 0.0f, 0.0f, 0, 0, "");
-   uiDefButF(block, NUM, B_NODE_EXEC, "", xstart+dx, dy, dx, 19, 
texmap->max, -1000.0f, 1000.0f, 10, 2, "");
+   col =uiLayoutColumn(layout, 1);
+   uiItemR(col, NULL, 0, ptr, "offset", 0);
+   uiItemR(col, NULL, 0, ptr, "size", 0);
+   
+   col =uiLayoutColumn(layout, 1);
+   uiItemR(col, NULL, 0, ptr, "use_min", 0);
+   sub =uiLayoutColumn(col, 0);
+   uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_min"));
+   uiItemR(sub, "", 0, ptr, "min", 0);
+   
+   col =uiLayoutColumn(layout, 1);
+   uiItemR(col, NULL, 0, ptr, "use_max", 0);
+   sub =uiLayoutColumn(col, 0);
+   uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max"));
+   uiItemR(sub, "", 0, ptr, "max", 0);
 }
 
 static void node_composit_buts_alphaover(uiLayout *layout, PointerRNA *ptr)
-{
-   uiBlock *block= uiLayoutFreeBlock(layout);
-   bNode *node= ptr->data;
-   rctf *butr= &node->butr;
-   NodeTwoFloats *ntf= node->storage;
+{  
+   uiLayout *col;

+   col =uiLayoutColumn(layout, 1);
/* alpha type */
-   uiDefButS(block, TOG, B_NODE_EXEC, "ConvertPremul",
- butr->xmin, butr->ymin+19, butr->xmax-butr->xmin, 19, 
- &node->custom1, 0, 0, 0, 0, "");
+   uiItemR(col, NULL, 0, ptr, "convert_premul", 0);
/* mix factor */
-   uiDefButF(block, NUM, B_NODE_EXEC, "Premul: ",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 19, 
- &ntf->x, 0.0f, 1.0f, 100, 0, "");
+   uiItemR(col, NULL, 0, ptr, "premul", 0);
 }
 
 static void node_composit_buts_hue_sat(uiLayout *layout, PointerRNA *ptr)
 {
-   uiBlock *block= uiLayoutFreeBlock(layout);
-   bNode *node= ptr->data;
-   rctf *butr= &node->butr;
-   NodeHueSat *nhs= node->storage;
+   uiLayout *col;

-   uiBlockBeginAlign(block);
-   uiDefButF(block, NUMSLI, B_NODE_EXEC, "Hue: ",
- butr->xmin, butr->ymin+40.0f, butr->xmax-butr->xmin, 
20, 
- &nhs->hue, 0.0f, 1.0f, 100, 0, "");
-   uiDefButF(block, NUMSLI, B_NODE_EXEC, "Sat: ",
- butr->xmin, butr->ymin+20.0f, butr->xmax-butr->xmin, 
20, 
- &nhs->sat, 0.0f, 2.0f, 100, 0, "");
-   uiDefButF(block, NUMSLI, B_NODE_EXEC, "Val: ",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, 
- &nhs->val, 0.0f, 2.0f, 100, 0, "");
+   col =uiLayoutColumn(layout, 1);
+   uiItemR(col, NULL, 0, ptr, "hue", UI_ITEM_R_SLIDER);
+   uiItemR(col, NULL, 0, ptr, "sat", UI_ITEM_R_SLIDER);
+   uiItemR(col, NULL, 0, ptr, "val", UI_ITEM_R_SLIDER);
 }
 
 static void node_composit_buts_dilateerode(uiLayout *layout, PointerRNA *ptr)
 {
-   uiBlock *block= uiLayoutFreeBlock(layout);
-   bNode *node= ptr->data;
- 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23353] trunk/blender: Bone constraints are now in a separate tab.

2009-09-19 Thread Brecht Van Lommel
Revision: 23353
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23353
Author:   blendix
Date: 2009-09-19 21:40:38 +0200 (Sat, 19 Sep 2009)

Log Message:
---
Bone constraints are now in a separate tab. It's more consistent
since object constraints also have their own tab, and I didn't
want to break context going from left to right.

Modified Paths:
--
trunk/blender/release/ui/buttons_data_bone.py
trunk/blender/release/ui/buttons_object_constraint.py
trunk/blender/source/blender/editors/space_buttons/buttons_context.c
trunk/blender/source/blender/editors/space_buttons/buttons_header.c
trunk/blender/source/blender/editors/space_buttons/space_buttons.c
trunk/blender/source/blender/makesdna/DNA_space_types.h
trunk/blender/source/blender/makesrna/intern/rna_space.c

Modified: trunk/blender/release/ui/buttons_data_bone.py
===
--- trunk/blender/release/ui/buttons_data_bone.py   2009-09-19 18:45:31 UTC 
(rev 23352)
+++ trunk/blender/release/ui/buttons_data_bone.py   2009-09-19 19:40:38 UTC 
(rev 23353)
@@ -74,6 +74,7 @@

 class BONE_PT_transform_locks(BoneButtonsPanel):
__label__ = "Transform Locks"
+   __default_closed__ = True

def poll(self, context):
return context.bone

Modified: trunk/blender/release/ui/buttons_object_constraint.py
===
--- trunk/blender/release/ui/buttons_object_constraint.py   2009-09-19 
18:45:31 UTC (rev 23352)
+++ trunk/blender/release/ui/buttons_object_constraint.py   2009-09-19 
19:40:38 UTC (rev 23353)
@@ -513,7 +513,7 @@
 
 class BONE_PT_constraints(ConstraintButtonsPanel):
__label__ = "Constraints"
-   __context__ = "bone"
+   __context__ = "bone_constraint"
 
def poll(self, context):
ob = context.object

Modified: trunk/blender/source/blender/editors/space_buttons/buttons_context.c
===
--- trunk/blender/source/blender/editors/space_buttons/buttons_context.c
2009-09-19 18:45:31 UTC (rev 23352)
+++ trunk/blender/source/blender/editors/space_buttons/buttons_context.c
2009-09-19 19:40:38 UTC (rev 23353)
@@ -463,6 +463,7 @@
found= buttons_context_path_texture(C, path);
break;
case BCONTEXT_BONE:
+   case BCONTEXT_BONE_CONSTRAINT:
found= buttons_context_path_bone(path);
if(!found)
found= buttons_context_path_data(path, 
OB_ARMATURE);

Modified: trunk/blender/source/blender/editors/space_buttons/buttons_header.c
===
--- trunk/blender/source/blender/editors/space_buttons/buttons_header.c 
2009-09-19 18:45:31 UTC (rev 23352)
+++ trunk/blender/source/blender/editors/space_buttons/buttons_header.c 
2009-09-19 19:40:38 UTC (rev 23353)
@@ -114,13 +114,15 @@
if(sbuts->pathflag & (1pathflag & (1mainb), 0.0, (float)BCONTEXT_CONSTRAINT, 0, 0, "Object Constraints");
if(sbuts->pathflag & (1mainb), 0.0, (float)BCONTEXT_DATA, 0, 0, "Object Data");
if(sbuts->pathflag & (1mainb), 0.0, 
(float)BCONTEXT_MODIFIER, 0, 0, "Modifiers");
if(sbuts->pathflag & (1pathflag & (1pathflag & (1pathflag & (1mainb == BCONTEXT_CONSTRAINT)
ED_region_panels(C, ar, vertical, "constraint", sbuts->mainb);
+   else if(sbuts->mainb == BCONTEXT_BONE_CONSTRAINT)
+   ED_region_panels(C, ar, vertical, "bone_constraint", 
sbuts->mainb);
 
 sbuts->re_align= 0;
sbuts->mainbo= sbuts->mainb;

Modified: trunk/blender/source/blender/makesdna/DNA_space_types.h
===
--- trunk/blender/source/blender/makesdna/DNA_space_types.h 2009-09-19 
18:45:31 UTC (rev 23352)
+++ trunk/blender/source/blender/makesdna/DNA_space_types.h 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23352] trunk/blender/source/blender/ editors/space_view3d: Fix drawing of armature bone axes, these were not showing labels.

2009-09-19 Thread Brecht Van Lommel
Revision: 23352
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23352
Author:   blendix
Date: 2009-09-19 20:45:31 +0200 (Sat, 19 Sep 2009)

Log Message:
---
Fix drawing of armature bone axes, these were not showing labels.

Also unified drawing code for object & particle text, was almost
the same function duplicated, and now also used for bones.

Modified Paths:
--
trunk/blender/source/blender/editors/space_view3d/drawarmature.c
trunk/blender/source/blender/editors/space_view3d/drawobject.c
trunk/blender/source/blender/editors/space_view3d/view3d_intern.h

Modified: trunk/blender/source/blender/editors/space_view3d/drawarmature.c
===
--- trunk/blender/source/blender/editors/space_view3d/drawarmature.c
2009-09-19 15:48:47 UTC (rev 23351)
+++ trunk/blender/source/blender/editors/space_view3d/drawarmature.c
2009-09-19 18:45:31 UTC (rev 23352)
@@ -639,7 +639,7 @@

/* figure out the sizes of spheres */
if (ebone) {
-   /* this routine doesn't call set_matrix_editbone() that 
calculates it */
+   /* this routine doesn't call get_matrix_editbone() that 
calculates it */
ebone->length = VecLenf(ebone->head, ebone->tail);

length= ebone->length;
@@ -749,7 +749,7 @@

/* figure out the sizes of spheres */
if (ebone) {
-   /* this routine doesn't call set_matrix_editbone() that 
calculates it */
+   /* this routine doesn't call get_matrix_editbone() that 
calculates it */
ebone->length = VecLenf(ebone->head, ebone->tail);

length= ebone->length;
@@ -1516,15 +1516,25 @@
}
 }
 
+static void bone_matrix_translate_y(float mat[][4], float y)
+{
+   float trans[3];
+
+   VECCOPY(trans, mat[1]);
+   VecMulf(trans, y);
+   VecAddf(mat[3], mat[3], trans);
+}
+
 /* assumes object is Armature with pose */
-static void draw_pose_channels(Scene *scene, View3D *v3d, RegionView3D *rv3d, 
Base *base, int dt)
+static void draw_pose_channels(Scene *scene, View3D *v3d, ARegion *ar, Base 
*base, int dt)
 {
+   RegionView3D *rv3d= ar->regiondata;
Object *ob= base->object;
bArmature *arm= ob->data;
bPoseChannel *pchan;
Bone *bone;
GLfloat tmp;
-   float smat[4][4], imat[4][4];
+   float smat[4][4], imat[4][4], bmat[4][4];
int index= -1;
short do_dashed= 3, draw_wire= 0;
short flag, constflag;
@@ -1809,15 +1819,21 @@
/*  Draw names of bone  
*/
if (arm->flag & ARM_DRAWNAMES) {
VecMidf(vec, 
pchan->pose_head, pchan->pose_tail);
-   
view3d_object_text_draw_add(vec[0], vec[1], vec[2], pchan->name, 10);
+   
view3d_cached_text_draw_add(vec[0], vec[1], vec[2], pchan->name, 10);
}   

/*  Draw additional axes on 
the bone tail  */
if ( (arm->flag & ARM_DRAWAXES) 
&& (arm->flag & ARM_POSEMODE) ) {
glPushMatrix();
-   
glMultMatrixf(pchan->pose_mat);
-   glTranslatef(0.0f, 
pchan->bone->length, 0.0f);
-   
drawaxes(0.25f*pchan->bone->length, 0, OB_ARROWS);
+   Mat4CpyMat4(bmat, 
pchan->pose_mat);
+   
bone_matrix_translate_y(bmat, pchan->bone->length);
+   glMultMatrixf(bmat);
+
+   /* do cached text draw 
immediate to include transform */
+   
view3d_cached_text_draw_begin();
+   
drawaxes(pchan->bone->length*0.25f, 0, OB_ARROWS);
+   
view3d_cached_text_draw_end(v3d, ar, 1, bmat);
+
glPopMatrix();
}
}
@@ -1830,32 +1846,28 @@
 }
 
 /* in editmode, we don't store the bone matrix... */
-static void set_matrix_editbone(EditBone *eBone)
+static void get_matrix_editbone(EditBone *eBone, float bmat[][4])
 {
-   float   delta[3],offset[3

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23351] trunk/blender/source/blender/ editors: Fix combined pose + weight paint mode, was using wrong object

2009-09-19 Thread Brecht Van Lommel
Revision: 23351
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23351
Author:   blendix
Date: 2009-09-19 17:48:47 +0200 (Sat, 19 Sep 2009)

Log Message:
---
Fix combined pose + weight paint mode, was using wrong object
in a few places, missing some checks.

Modified Paths:
--
trunk/blender/source/blender/editors/armature/editarmature.c
trunk/blender/source/blender/editors/space_view3d/drawarmature.c
trunk/blender/source/blender/editors/space_view3d/view3d_select.c
trunk/blender/source/blender/editors/transform/transform_conversions.c

Modified: trunk/blender/source/blender/editors/armature/editarmature.c
===
--- trunk/blender/source/blender/editors/armature/editarmature.c
2009-09-19 14:16:02 UTC (rev 23350)
+++ trunk/blender/source/blender/editors/armature/editarmature.c
2009-09-19 15:48:47 UTC (rev 23351)
@@ -4333,7 +4333,7 @@
}

/* in weightpaint we select the associated vertex group too */
-   if (ob->mode & OB_MODE_WEIGHT_PAINT) {
+   if (OBACT && OBACT->mode & OB_MODE_WEIGHT_PAINT) {
if (nearBone->flag & BONE_ACTIVE) {
ED_vgroup_select_by_name(OBACT, nearBone->name);
DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA);

Modified: trunk/blender/source/blender/editors/space_view3d/drawarmature.c
===
--- trunk/blender/source/blender/editors/space_view3d/drawarmature.c
2009-09-19 14:16:02 UTC (rev 23350)
+++ trunk/blender/source/blender/editors/space_view3d/drawarmature.c
2009-09-19 15:48:47 UTC (rev 23351)
@@ -2513,7 +2513,11 @@
/* drawing posemode selection indices or colors only in 
these cases */
if(!(base->flag & OB_FROMDUPLI)) {
if(G.f & G_PICKSEL) {
-   if(ob->mode & OB_MODE_POSE) 
+   if(OBACT && (OBACT->mode & 
OB_MODE_WEIGHT_PAINT)) {
+   
if(ob==modifiers_isDeformedByArmature(OBACT))
+   arm->flag |= 
ARM_POSEMODE;
+   }
+   else if(ob->mode & OB_MODE_POSE) 
arm->flag |= ARM_POSEMODE;
}
else if(ob->mode & OB_MODE_POSE) {
@@ -2530,8 +2534,8 @@
if ((flag & DRAW_SCENESET)==0) {
if(ob==OBACT) 
arm->flag |= 
ARM_POSEMODE;
-   else if(ob->mode & 
OB_MODE_WEIGHT_PAINT) {
-   if(OBACT && 
ob==modifiers_isDeformedByArmature(OBACT))
+   else if(OBACT && (OBACT->mode & 
OB_MODE_WEIGHT_PAINT)) {
+   
if(ob==modifiers_isDeformedByArmature(OBACT))
arm->flag |= 
ARM_POSEMODE;
}
draw_pose_paths(scene, v3d, 
rv3d, ob);

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_select.c
===
--- trunk/blender/source/blender/editors/space_view3d/view3d_select.c   
2009-09-19 14:16:02 UTC (rev 23350)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_select.c   
2009-09-19 15:48:47 UTC (rev 23351)
@@ -1148,7 +1148,7 @@
WM_event_add_notifier(C, 
NC_OBJECT|ND_BONE_ACTIVE, basact->object);

/* in weightpaint, we use selected bone 
to select vertexgroup, so no switch to new active object */
-   if(basact->object->mode & 
OB_MODE_WEIGHT_PAINT) {
+   if(BASACT && BASACT->object->mode & 
OB_MODE_WEIGHT_PAINT) {
/* prevent activating */
basact= NULL;
}

Modified: trunk/blender/source/blender/editors/transform/transform_conversions.c
===
--- trunk/blender/source/blender/editors/transform/transform_conversions.c  
2009-09-19 14:16:02 UTC (rev 23350)
+++ trunk/blender/source/blender/editors/transform/transform_conversions.c  
2009-09-19 15:48:47 UTC 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23350] trunk/blender/source/blender/ makesrna/intern/rna_armature.c: RNA: for last commit, fix paths_location and paths_type enums,

2009-09-19 Thread Brecht Van Lommel
Revision: 23350
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23350
Author:   blendix
Date: 2009-09-19 16:16:02 +0200 (Sat, 19 Sep 2009)

Log Message:
---
RNA: for last commit, fix paths_location and paths_type enums,
these had wrong DNA variable name already before this change.

Modified Paths:
--
trunk/blender/source/blender/makesrna/intern/rna_armature.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_armature.c
===
--- trunk/blender/source/blender/makesrna/intern/rna_armature.c 2009-09-19 
13:50:24 UTC (rev 23349)
+++ trunk/blender/source/blender/makesrna/intern/rna_armature.c 2009-09-19 
14:16:02 UTC (rev 23350)
@@ -577,13 +577,13 @@
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");

prop= RNA_def_property(srna, "paths_type", PROP_ENUM, PROP_NONE);
-   RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+   RNA_def_property_enum_bitflag_sdna(prop, NULL, "pathflag");
RNA_def_property_enum_items(prop, prop_paths_type_items);
RNA_def_property_ui_text(prop, "Paths Type", "Mapping type to use for 
this image in the game engine.");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");

prop= RNA_def_property(srna, "paths_location", PROP_ENUM, PROP_NONE);
-   RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+   RNA_def_property_enum_bitflag_sdna(prop, NULL, "pathflag");
RNA_def_property_enum_items(prop, prop_paths_location_items);
RNA_def_property_ui_text(prop, "Paths Location", "When calculating Bone 
Paths, use Head or Tips");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23349] trunk/blender: Armature UI

2009-09-19 Thread William Reynish
Revision: 23349
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23349
Author:   billrey
Date: 2009-09-19 15:50:24 +0200 (Sat, 19 Sep 2009)

Log Message:
---
Armature UI

Added the new pose tools in the toolbar.
Changed a few armature values to enums. 

Brecht: The Heads/Tails enum seems to also enable armature.draw_axis, and the 
paths_type enum affects armature.draw_names

Modified Paths:
--
trunk/blender/release/ui/buttons_data_armature.py
trunk/blender/release/ui/space_view3d_toolbar.py
trunk/blender/source/blender/makesrna/intern/rna_armature.c

Modified: trunk/blender/release/ui/buttons_data_armature.py
===
--- trunk/blender/release/ui/buttons_data_armature.py   2009-09-19 12:38:49 UTC 
(rev 23348)
+++ trunk/blender/release/ui/buttons_data_armature.py   2009-09-19 13:50:24 UTC 
(rev 23349)
@@ -121,28 +121,31 @@
layout = self.layout

arm = context.armature
-
+   
+   layout.itemR(arm, "paths_type", expand=True)
+   
split = layout.split()

col = split.column()
-   col.itemR(arm, "paths_show_around_current_frame", text="Around 
Frame")

sub = col.column(align=True)
-   if (arm.paths_show_around_current_frame):
+   if (arm.paths_type == 'CURRENT_FRAME'):
sub.itemR(arm, "path_before_current", text="Before")
sub.itemR(arm, "path_after_current", text="After")
-   else:
+   elif (arm.paths_type == 'RANGE'):
sub.itemR(arm, "path_start_frame", text="Start")
sub.itemR(arm, "path_end_frame", text="End")
 
-   sub.itemR(arm, "path_size", text="Step")
-   col.itemR(arm, "paths_calculate_head_positions", text="Head")
+   sub.itemR(arm, "path_size", text="Step")
+   col.row().itemR(arm, "paths_location", expand=True)

col = split.column()
col.itemL(text="Show:")
col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe 
Numbers")
+   
+   layout.itemO("pose.paths_calculate")
 
 class DATA_PT_ghost(DataButtonsPanel):
__label__ = "Ghost"
@@ -151,11 +154,12 @@
layout = self.layout

arm = context.armature
-
+   
+   layout.itemR(arm, "ghost_type", expand=True)
+   
split = layout.split()
 
col = split.column()
-   col.itemR(arm, "ghost_type", text="")
 
sub = col.column(align=True)
if arm.ghost_type == 'RANGE':

Modified: trunk/blender/release/ui/space_view3d_toolbar.py
===
--- trunk/blender/release/ui/space_view3d_toolbar.py2009-09-19 12:38:49 UTC 
(rev 23348)
+++ trunk/blender/release/ui/space_view3d_toolbar.py2009-09-19 13:50:24 UTC 
(rev 23349)
@@ -299,11 +299,13 @@
col.itemL(text="Pose:")
col.itemO("pose.copy", text="Copy")
col.itemO("pose.paste", text="Paste")
+   col.itemO("poselib.pose_add", text="Add To library")

col = layout.column(align=True)
-   col.itemL(text="Library:")
-   col.itemO("poselib.pose_add", text="Add")
-   col.itemO("poselib.pose_remove", text="Remove")
+   col.itemL(text="In-Between:")
+   col.itemO("pose.relax", text="Relax")
+   col.itemO("pose.push", text="Push")
+   col.itemO("pose.breakdown", text="Breakdowner")

col = layout.column(align=True)
col.itemL(text="Repeat:")

Modified: trunk/blender/source/blender/makesrna/intern/rna_armature.c
===
--- trunk/blender/source/blender/makesrna/intern/rna_armature.c 2009-09-19 
12:38:49 UTC (rev 23348)
+++ trunk/blender/source/blender/makesrna/intern/rna_armature.c 2009-09-19 
13:50:24 UTC (rev 23349)
@@ -526,16 +526,25 @@
PropertyRNA *prop;

static EnumPropertyItem prop_drawtype_items[] = {
-   {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Draw bones as 
octahedral shape (default)."},
-   {ARM_LINE, "STICK", 0, "Stick", "Draw bones as simple 2D lines 
with dots."},
-   {ARM_B_BONE, "BBONE", 0, "B-Bone", "Draw bones as boxes, 
showing subdivision and B-Splines"},
-   {ARM_ENVELOPE, "ENVELOPE", 0, "

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23348] trunk/blender/source/blender: Missed one file in previous commit, and silencing some compiler warnings I overlooked.

2009-09-19 Thread Joshua Leung
Revision: 23348
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23348
Author:   aligorith
Date: 2009-09-19 14:38:49 +0200 (Sat, 19 Sep 2009)

Log Message:
---
Missed one file in previous commit, and silencing some compiler warnings I 
overlooked.

Modified Paths:
--
trunk/blender/source/blender/blenkernel/intern/anim_sys.c
trunk/blender/source/blender/editors/space_nla/space_nla.c

Modified: trunk/blender/source/blender/blenkernel/intern/anim_sys.c
===
--- trunk/blender/source/blender/blenkernel/intern/anim_sys.c   2009-09-19 
12:36:22 UTC (rev 23347)
+++ trunk/blender/source/blender/blenkernel/intern/anim_sys.c   2009-09-19 
12:38:49 UTC (rev 23348)
@@ -1547,8 +1547,8 @@

/* do compositing nodes first (since these aren't included in 
main tree) */
if (scene->nodetree) {
-   AnimData *adt2= BKE_animdata_from_id(scene->nodetree);
-   BKE_animsys_evaluate_animdata(scene->nodetree, adt2, 
ctime, ADT_RECALC_ANIM);
+   AnimData *adt2= BKE_animdata_from_id((ID 
*)scene->nodetree);
+   BKE_animsys_evaluate_animdata((ID *)scene->nodetree, 
adt2, ctime, ADT_RECALC_ANIM);
}

/* now execute scene animation data as per normal */

Modified: trunk/blender/source/blender/editors/space_nla/space_nla.c
===
--- trunk/blender/source/blender/editors/space_nla/space_nla.c  2009-09-19 
12:36:22 UTC (rev 23347)
+++ trunk/blender/source/blender/editors/space_nla/space_nla.c  2009-09-19 
12:38:49 UTC (rev 23348)
@@ -409,6 +409,7 @@
break;
case NC_SCENE:
switch(wmn->data) {
+   case ND_RENDER_OPTIONS:
case ND_OB_ACTIVE:
case ND_FRAME:
case ND_MARKERS:


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23347] trunk/blender/source/blender: 2. 5 - More Animation Bugfixes

2009-09-19 Thread Joshua Leung
Revision: 23347
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23347
Author:   aligorith
Date: 2009-09-19 14:36:22 +0200 (Sat, 19 Sep 2009)

Log Message:
---
2.5 - More Animation Bugfixes

* Updating Preview Range settings results in correct updates for Animation 
Editors

* Compositing nodes now correctly animate when the values were set by IKEY/RMB 
on suitable node parameters. Beware that these nodes are not relinkable 
node-trees, hence the standard code not working.

* Ctrl-P to parent objects to bones now works in Pose Mode too. I needed to add 
a special keymap entry for this, though I thought this would have been better 
to be automatically inherited/present from Object keymap already?
* Ctrl-P -> Parent to Bone option now works correctly again. 1.5 lines of code 
missing here...

* Breakdowns tool now shows custom cursor during 'modal' phase so that it's not 
that confusing what's going on.

Modified Paths:
--
trunk/blender/source/blender/blenkernel/intern/anim_sys.c
trunk/blender/source/blender/editors/armature/armature_ops.c
trunk/blender/source/blender/editors/armature/poseSlide.c
trunk/blender/source/blender/editors/object/object_relations.c
trunk/blender/source/blender/editors/space_action/space_action.c
trunk/blender/source/blender/editors/space_graph/space_graph.c

Modified: trunk/blender/source/blender/blenkernel/intern/anim_sys.c
===
--- trunk/blender/source/blender/blenkernel/intern/anim_sys.c   2009-09-19 
11:59:23 UTC (rev 23346)
+++ trunk/blender/source/blender/blenkernel/intern/anim_sys.c   2009-09-19 
12:36:22 UTC (rev 23347)
@@ -40,6 +40,7 @@
 #include "BLI_dynstr.h"
 
 #include "DNA_anim_types.h"
+#include "DNA_scene_types.h"
 
 #include "BKE_animsys.h"
 #include "BKE_action.h"
@@ -1517,7 +1518,10 @@
AnimData *adt= BKE_animdata_from_id(id);
Curve *cu= (Curve *)id;

+   /* set ctime variable for curve */
cu->ctime= ctime;
+   
+   /* now execute animation data on top of this as per normal */
BKE_animsys_evaluate_animdata(id, adt, ctime, ADT_RECALC_ANIM);
}

@@ -1537,7 +1541,19 @@
EVAL_ANIM_IDS(main->world.first, ADT_RECALC_ANIM);

/* scenes */
-   EVAL_ANIM_IDS(main->scene.first, ADT_RECALC_ANIM);
+   for (id= main->scene.first; id; id= id->next) {
+   AnimData *adt= BKE_animdata_from_id(id);
+   Scene *scene= (Scene *)id;
+   
+   /* do compositing nodes first (since these aren't included in 
main tree) */
+   if (scene->nodetree) {
+   AnimData *adt2= BKE_animdata_from_id(scene->nodetree);
+   BKE_animsys_evaluate_animdata(scene->nodetree, adt2, 
ctime, ADT_RECALC_ANIM);
+   }
+   
+   /* now execute scene animation data as per normal */
+   BKE_animsys_evaluate_animdata(id, adt, ctime, ADT_RECALC_ANIM);
+   }
 }
 
 /* * */ 

Modified: trunk/blender/source/blender/editors/armature/armature_ops.c
===
--- trunk/blender/source/blender/editors/armature/armature_ops.c
2009-09-19 11:59:23 UTC (rev 23346)
+++ trunk/blender/source/blender/editors/armature/armature_ops.c
2009-09-19 12:36:22 UTC (rev 23347)
@@ -298,6 +298,9 @@
keymap= WM_keymap_find(wm, "Pose", 0, 0);
keymap->poll= ED_operator_posemode;

+   // XXX: set parent is object-based operator, but it should also be 
available here...
+   WM_keymap_add_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, 
KM_CTRL, 0);
+   
WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, 0, 0);
kmi= WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, 
KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "unselected", 1);
@@ -310,7 +313,6 @@
WM_keymap_add_item(keymap, "POSE_OT_loc_clear", GKEY, KM_PRESS, KM_ALT, 
0);
WM_keymap_add_item(keymap, "POSE_OT_scale_clear", SKEY, KM_PRESS, 
KM_ALT, 0);

-   // for now, we include hotkeys for copy/paste
WM_keymap_add_item(keymap, "POSE_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
kmi= WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, 
KM_CTRL|KM_SHIFT, 0);

Modified: trunk/blender/source/blender/editors/armature/poseSlide.c
===
--- trunk/blender/source/blender/editors/armature/poseSlide.c   2009-09-19 
11:59:23 UTC (rev 23346)
+++ trunk/blender/source/blender/editors/armature/poseSlide.c   2009-09-19 
12:36:22 UTC (rev 23347)
@@ -480,6 +480,7 @@
 {
  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23346] trunk/blender/source/blender: 2. 5 - Animation Bugfixes:

2009-09-19 Thread Joshua Leung
Revision: 23346
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23346
Author:   aligorith
Date: 2009-09-19 13:59:23 +0200 (Sat, 19 Sep 2009)

Log Message:
---
2.5 - Animation Bugfixes:

* Breakdown tool for Poses (Shift-E in PoseMode) now works. Now this works as a 
modal operator when invoked, with the horizontal movement of the mouse (left to 
right) corresponding the placement of the breakdown relative to the endpoint 
keyframes.

* Moving bones between armature layers in Edit Mode didn't work (wrong variable 
name used)
* Fixed several notifier-related bugs regarding editing armature settings and 
the 3d-view not refreshing
* Duplicating bones preserves the rotation mode

* Animation Data for Nodes is now show in Datablocks viewer (i.e. AnimData for 
NodeTrees has now been wrapped)

Modified Paths:
--
trunk/blender/source/blender/editors/animation/keyframes_draw.c
trunk/blender/source/blender/editors/armature/editarmature.c
trunk/blender/source/blender/editors/armature/poseSlide.c
trunk/blender/source/blender/editors/armature/poseobject.c
trunk/blender/source/blender/editors/space_view3d/space_view3d.c
trunk/blender/source/blender/makesrna/intern/rna_nodetree.c

Modified: trunk/blender/source/blender/editors/animation/keyframes_draw.c
===
--- trunk/blender/source/blender/editors/animation/keyframes_draw.c 
2009-09-19 02:00:42 UTC (rev 23345)
+++ trunk/blender/source/blender/editors/animation/keyframes_draw.c 
2009-09-19 11:59:23 UTC (rev 23346)
@@ -332,6 +332,7 @@
 }
 
 /* helper function - find actkeycolumn that occurs on cframe, or the nearest 
one if not found */
+// FIXME: this is buggy... next() is ignored completely...
 ActKeyColumn *cfra_find_nearest_next_ak (ActKeyColumn *ak, float cframe, short 
next)
 {
ActKeyColumn *akn= NULL;

Modified: trunk/blender/source/blender/editors/armature/editarmature.c
===
--- trunk/blender/source/blender/editors/armature/editarmature.c
2009-09-19 02:00:42 UTC (rev 23345)
+++ trunk/blender/source/blender/editors/armature/editarmature.c
2009-09-19 11:59:23 UTC (rev 23346)
@@ -2630,6 +2630,9 @@
/* copy 
transform locks */

channew->protectflag = chanold->protectflag;

+   /* copy 
rotation mode */
+   
channew->rotmode = chanold->rotmode;
+   
/* copy bone 
group */

channew->agrp_index= chanold->agrp_index;


Modified: trunk/blender/source/blender/editors/armature/poseSlide.c
===
--- trunk/blender/source/blender/editors/armature/poseSlide.c   2009-09-19 
02:00:42 UTC (rev 23345)
+++ trunk/blender/source/blender/editors/armature/poseSlide.c   2009-09-19 
11:59:23 UTC (rev 23346)
@@ -103,6 +103,7 @@
Scene *scene;   /* current scene */
ARegion *ar;/* region that we're operating in (needed for  
*/
Object *ob; /* active object that Pose Info comes 
from */
+   bArmature *arm; /* armature for pose */

ListBase pfLinks;   /* links between posechannels and f-curves  */
DLRBT_Tree keys;/* binary tree for quicker searching for 
keyframes (when applicable) */
@@ -151,6 +152,7 @@
/* get info from context */
pso->scene= CTX_data_scene(C);
pso->ob= CTX_data_active_object(C);
+   pso->arm= (pso->ob)? pso->ob->data : NULL;
pso->ar= CTX_wm_region(C); /* only really needed when doing modal() */

pso->cframe= pso->scene->r.cfra;
@@ -162,7 +164,7 @@
pso->nextFrame= RNA_int_get(op->ptr, "next_frame");

/* check the settings from the context */
-   if (ELEM3(NULL, pso->ob, pso->ob->adt, pso->ob->adt->action))
+   if (ELEM4(NULL, pso->ob, pso->arm, pso->ob->adt, pso->ob->adt->action))
return 0;
else
act= pso->ob->adt->action;
@@ -204,6 +206,11 @@
}
CTX_DATA_END;

+   /* set depsgraph flags */
+   /* make sure the lock is set OK, unlock can be accidentally 
saved? */
+   pso->ob->pose->flag |= POSE_LOCKED;
+   pso->ob->pose->flag &= ~POSE_DO_UNLOCK;
+   
/* do basic initialise of RB-BST used for finding keyframes, but leave