[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54916] trunk/blender/source/blender/ editors/armature: Renaming the remaining PoseMode files for consistency ( camelCase to

Joshua Leung aligorith at gmail.com
Thu Feb 28 01:01:21 CET 2013


Revision: 54916
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54916
Author:   aligorith
Date:     2013-02-28 00:01:20 +0000 (Thu, 28 Feb 2013)
Log Message:
-----------
Renaming the remaining PoseMode files for consistency (camelCase to
underscores_style)

Modified Paths:
--------------
    trunk/blender/source/blender/editors/armature/CMakeLists.txt
    trunk/blender/source/blender/editors/armature/armature_intern.h

Added Paths:
-----------
    trunk/blender/source/blender/editors/armature/pose_lib.c
    trunk/blender/source/blender/editors/armature/pose_slide.c
    trunk/blender/source/blender/editors/armature/pose_utils.c

Removed Paths:
-------------
    trunk/blender/source/blender/editors/armature/poseSlide.c
    trunk/blender/source/blender/editors/armature/poseUtils.c
    trunk/blender/source/blender/editors/armature/poselib.c

Modified: trunk/blender/source/blender/editors/armature/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/editors/armature/CMakeLists.txt	2013-02-27 23:56:51 UTC (rev 54915)
+++ trunk/blender/source/blender/editors/armature/CMakeLists.txt	2013-02-28 00:01:20 UTC (rev 54916)
@@ -48,12 +48,12 @@
 	editarmature_sketch.c
 	meshlaplacian.c
 	pose_edit.c
+	pose_lib.c
 	pose_group.c
 	pose_select.c
+	pose_slide.c
 	pose_transform.c
-	poseSlide.c
-	poseUtils.c
-	poselib.c
+	pose_utils.c
 	reeb.c
 
 	BIF_generate.h

Modified: trunk/blender/source/blender/editors/armature/armature_intern.h
===================================================================
--- trunk/blender/source/blender/editors/armature/armature_intern.h	2013-02-27 23:56:51 UTC (rev 54915)
+++ trunk/blender/source/blender/editors/armature/armature_intern.h	2013-02-28 00:01:20 UTC (rev 54916)
@@ -146,7 +146,7 @@
 
 /* ******************************************************* */
 /* Pose Tool Utilities (for PoseLib, Pose Sliding, etc.) */
-/* poseUtils.c */
+/* pose_utils.c */
 
 /* Temporary data linking PoseChannels with the F-Curves they affect */
 typedef struct tPChanFCurveLink {
@@ -180,7 +180,7 @@
 
 /* ******************************************************* */
 /* PoseLib */
-/* poselib.c */
+/* pose_lib.c */
 
 void POSELIB_OT_new(struct wmOperatorType *ot);
 void POSELIB_OT_unlink(struct wmOperatorType *ot);
@@ -196,7 +196,7 @@
 
 /* ******************************************************* */
 /* Pose Sliding Tools */
-/* poseSlide.c */
+/* pose_slide.c */
 
 void POSE_OT_push(struct wmOperatorType *ot);
 void POSE_OT_relax(struct wmOperatorType *ot);

Deleted: trunk/blender/source/blender/editors/armature/poseSlide.c
===================================================================
--- trunk/blender/source/blender/editors/armature/poseSlide.c	2013-02-27 23:56:51 UTC (rev 54915)
+++ trunk/blender/source/blender/editors/armature/poseSlide.c	2013-02-28 00:01:20 UTC (rev 54916)
@@ -1,1261 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2009, Blender Foundation, Joshua Leung
- * This is a new part of Blender
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/editors/armature/poseSlide.c
- *  \ingroup edarmature
- */
-
- 
-#include <stdlib.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <string.h>
-#include <math.h>
-#include <float.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
-#include "BLI_dlrbTree.h"
-#include "BLI_utildefines.h"
-
-#include "DNA_anim_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-
-#include "BKE_fcurve.h"
-
-#include "BKE_context.h"
-#include "BKE_object.h"
-#include "BKE_report.h"
-
-#include "RNA_access.h"
-#include "RNA_define.h"
-
-#include "WM_api.h"
-#include "WM_types.h"
-
-#include "ED_armature.h"
-#include "ED_keyframes_draw.h"
-#include "ED_markers.h"
-#include "ED_screen.h"
-
-#include "armature_intern.h"
-
-/* **************************************************** */
-/* == POSE 'SLIDING' TOOLS == 
- *
- * A) Push & Relax, Breakdowner
- * These tools provide the animator with various capabilities
- * for interactively controlling the spacing of poses, but also
- * for 'pushing' and/or 'relaxing' extremes as they see fit.
- *
- * B) Propagate
- * This tool copies elements of the selected pose to successive
- * keyframes, allowing the animator to go back and modify the poses
- * for some "static" pose controls, without having to repeatedly
- * doing a "next paste" dance.
- *
- * C) Pose Sculpting
- * This is yet to be implemented, but the idea here is to use
- * sculpting techniques to make it easier to pose rigs by allowing
- * rigs to be manipulated using a familiar paint-based interface. 
- */
-/* **************************************************** */
-/* A) Push & Relax, Breakdowner */
-
-/* Temporary data shared between these operators */
-typedef struct tPoseSlideOp {
-	Scene *scene;       /* current scene */
-	ScrArea *sa;        /* area that we're operating in (needed for modal()) */
-	ARegion *ar;        /* region that we're operating in (needed for modal()) */
-	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) */
-
-	int cframe;         /* current frame number */
-	int prevFrame;      /* frame before current frame (blend-from) */
-	int nextFrame;      /* frame after current frame (blend-to) */
-	
-	int mode;           /* sliding mode (ePoseSlide_Modes) */
-	int flag;           /* unused for now, but can later get used for storing runtime settings.... */
-	
-	float percentage;   /* 0-1 value for determining the influence of whatever is relevant */
-} tPoseSlideOp;
-
-/* Pose Sliding Modes */
-typedef enum ePoseSlide_Modes {
-	POSESLIDE_PUSH  = 0,        /* exaggerate the pose... */
-	POSESLIDE_RELAX,            /* soften the pose... */
-	POSESLIDE_BREAKDOWN,        /* slide between the endpoint poses, finding a 'soft' spot */
-} ePoseSlide_Modes;
-
-/* ------------------------------------ */
-
-/* operator init */
-static int pose_slide_init(bContext *C, wmOperator *op, short mode)
-{
-	tPoseSlideOp *pso;
-	bAction *act = NULL;
-	
-	/* init slide-op data */
-	pso = op->customdata = MEM_callocN(sizeof(tPoseSlideOp), "tPoseSlideOp");
-	
-	/* get info from context */
-	pso->scene = CTX_data_scene(C);
-	pso->ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
-	pso->arm = (pso->ob) ? pso->ob->data : NULL;
-	pso->sa = CTX_wm_area(C); /* only really needed when doing modal() */
-	pso->ar = CTX_wm_region(C); /* only really needed when doing modal() */
-	
-	pso->cframe = pso->scene->r.cfra;
-	pso->mode = mode;
-	
-	/* set range info from property values - these may get overridden for the invoke() */
-	pso->percentage = RNA_float_get(op->ptr, "percentage");
-	pso->prevFrame = RNA_int_get(op->ptr, "prev_frame");
-	pso->nextFrame = RNA_int_get(op->ptr, "next_frame");
-	
-	/* check the settings from the context */
-	if (ELEM4(NULL, pso->ob, pso->arm, pso->ob->adt, pso->ob->adt->action))
-		return 0;
-	else
-		act = pso->ob->adt->action;
-	
-	/* for each Pose-Channel which gets affected, get the F-Curves for that channel 
-	 * and set the relevant transform flags...
-	 */
-	poseAnim_mapping_get(C, &pso->pfLinks, pso->ob, act);
-	
-	/* 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 initialize of RB-BST used for finding keyframes, but leave the filling of it up 
-	 * to the caller of this (usually only invoke() will do it, to make things more efficient).
-	 */
-	BLI_dlrbTree_init(&pso->keys);
-	
-	/* return status is whether we've got all the data we were requested to get */
-	return 1;
-}
-
-/* exiting the operator - free data */
-static void pose_slide_exit(wmOperator *op)
-{
-	tPoseSlideOp *pso = op->customdata;
-	
-	/* if data exists, clear its data and exit */
-	if (pso) {
-		/* free the temp pchan links and their data */
-		poseAnim_mapping_free(&pso->pfLinks);
-		
-		/* free RB-BST for keyframes (if it contained data) */
-		BLI_dlrbTree_free(&pso->keys);
-		
-		/* free data itself */
-		MEM_freeN(pso);
-	}
-	
-	/* cleanup */
-	op->customdata = NULL;
-}
-
-/* ------------------------------------ */
-
-/* helper for apply() / reset() - refresh the data */
-static void pose_slide_refresh(bContext *C, tPoseSlideOp *pso)
-{
-	/* wrapper around the generic version, allowing us to add some custom stuff later still */
-	poseAnim_mapping_refresh(C, pso->scene, pso->ob);
-}
-
-/* helper for apply() - perform sliding for some value */
-static void pose_slide_apply_val(tPoseSlideOp *pso, FCurve *fcu, float *val)
-{
-	float cframe = (float)pso->cframe;
-	float sVal, eVal;
-	float w1, w2;
-	
-	/* get keyframe values for endpoint poses to blend with */
-	/* previous/start */
-	sVal = evaluate_fcurve(fcu, (float)pso->prevFrame);
-	/* next/end */
-	eVal = evaluate_fcurve(fcu, (float)pso->nextFrame);
-	
-	/* calculate the relative weights of the endpoints */
-	if (pso->mode == POSESLIDE_BREAKDOWN) {
-		/* get weights from the percentage control */
-		w1 = pso->percentage;    /* this must come second */
-		w2 = 1.0f - w1;          /* this must come first */
-	}
-	else {
-		/*	- these weights are derived from the relative distance of these 
-		 *	  poses from the current frame
-		 *	- they then get normalized so that they only sum up to 1
-		 */
-		float wtot; 
-		
-		w1 = cframe - (float)pso->prevFrame;
-		w2 = (float)pso->nextFrame - cframe;
-		
-		wtot = w1 + w2;
-		w1 = (w1 / wtot);
-		w2 = (w2 / wtot);
-	}
-	
-	/* 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 */
-		{
-			/* perform a weighted average here, favoring 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) {
-				(*val) = (-((sVal * w2) + (eVal * w1)) + ((*val) * 6.0f) ) / 5.0f;
-			}

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list