2002-10-12 11:37:38 +00:00
|
|
|
/* deform.c June 2001
|
|
|
|
*
|
|
|
|
* support for deformation groups
|
|
|
|
*
|
|
|
|
* Reevan McKay
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* 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
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <string.h>
|
2004-11-06 21:59:35 +00:00
|
|
|
#include <math.h>
|
2010-01-15 17:28:00 +00:00
|
|
|
#include "ctype.h"
|
2004-09-14 19:03:11 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
2004-09-14 19:03:11 +00:00
|
|
|
|
|
|
|
#include "DNA_curve_types.h"
|
2004-09-19 17:44:20 +00:00
|
|
|
#include "DNA_effect_types.h"
|
2004-09-14 19:03:11 +00:00
|
|
|
#include "DNA_lattice_types.h"
|
|
|
|
#include "DNA_mesh_types.h"
|
|
|
|
#include "DNA_meshdata_types.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "DNA_object_types.h"
|
2005-05-02 13:28:13 +00:00
|
|
|
#include "DNA_object_force.h"
|
2004-10-01 14:04:17 +00:00
|
|
|
#include "DNA_scene_types.h"
|
2004-09-14 19:03:11 +00:00
|
|
|
|
|
|
|
#include "BKE_curve.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BKE_deform.h"
|
2004-09-14 19:03:11 +00:00
|
|
|
#include "BKE_displist.h"
|
2004-09-19 17:44:20 +00:00
|
|
|
#include "BKE_effect.h"
|
2004-10-01 14:04:17 +00:00
|
|
|
#include "BKE_global.h"
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
#include "BKE_key.h"
|
2004-09-14 19:03:11 +00:00
|
|
|
#include "BKE_lattice.h"
|
2004-10-01 14:04:17 +00:00
|
|
|
#include "BKE_object.h"
|
|
|
|
#include "BKE_softbody.h"
|
2004-09-14 19:03:11 +00:00
|
|
|
#include "BKE_utildefines.h"
|
2005-07-22 17:03:50 +00:00
|
|
|
#include "BKE_mesh.h"
|
2004-09-14 19:03:11 +00:00
|
|
|
|
|
|
|
#include "BLI_blenlib.h"
|
2009-11-10 20:43:45 +00:00
|
|
|
#include "BLI_math.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2002-11-25 12:02:15 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include <config.h>
|
|
|
|
#endif
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
2007-04-27 11:16:35 +00:00
|
|
|
void copy_defgroups (ListBase *outbase, ListBase *inbase)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
bDeformGroup *defgroup, *defgroupn;
|
|
|
|
|
|
|
|
outbase->first= outbase->last= 0;
|
|
|
|
|
|
|
|
for (defgroup = inbase->first; defgroup; defgroup=defgroup->next){
|
|
|
|
defgroupn= copy_defgroup(defgroup);
|
|
|
|
BLI_addtail(outbase, defgroupn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-04-27 11:16:35 +00:00
|
|
|
bDeformGroup *copy_defgroup (bDeformGroup *ingroup)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
bDeformGroup *outgroup;
|
|
|
|
|
|
|
|
if (!ingroup)
|
|
|
|
return NULL;
|
|
|
|
|
2005-10-20 20:38:08 +00:00
|
|
|
outgroup=MEM_callocN(sizeof(bDeformGroup), "copy deformGroup");
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
/* For now, just copy everything over. */
|
|
|
|
memcpy (outgroup, ingroup, sizeof(bDeformGroup));
|
|
|
|
|
|
|
|
outgroup->next=outgroup->prev=NULL;
|
|
|
|
|
|
|
|
return outgroup;
|
|
|
|
}
|
|
|
|
|
2010-01-15 17:28:00 +00:00
|
|
|
void copy_defvert (MDeformVert *dvert_r, const MDeformVert *dvert)
|
|
|
|
{
|
|
|
|
if(dvert_r->totweight == dvert->totweight) {
|
|
|
|
if(dvert->totweight)
|
|
|
|
memcpy(dvert_r->dw, dvert->dw, dvert->totweight * sizeof(MDeformWeight));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if(dvert_r->dw)
|
|
|
|
MEM_freeN(dvert_r->dw);
|
|
|
|
|
|
|
|
if(dvert->totweight)
|
|
|
|
dvert_r->dw= MEM_dupallocN(dvert->dw);
|
|
|
|
else
|
|
|
|
dvert_r->dw= NULL;
|
|
|
|
|
|
|
|
dvert_r->totweight = dvert->totweight;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void flip_defvert (MDeformVert *dvert, int *flip_map)
|
|
|
|
{
|
|
|
|
MDeformWeight *dw;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for(dw= dvert->dw, i=0; i<dvert->totweight; dw++, i++)
|
|
|
|
if(flip_map[dw->def_nr] >= 0)
|
|
|
|
dw->def_nr= flip_map[dw->def_nr];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-04-27 11:16:35 +00:00
|
|
|
bDeformGroup *get_named_vertexgroup (Object *ob, char *name)
|
2005-01-12 23:57:33 +00:00
|
|
|
{
|
|
|
|
/* return a pointer to the deform group with this name
|
|
|
|
* or return NULL otherwise.
|
|
|
|
*/
|
|
|
|
bDeformGroup *curdef;
|
|
|
|
|
2007-04-27 11:16:35 +00:00
|
|
|
for (curdef = ob->defbase.first; curdef; curdef=curdef->next) {
|
|
|
|
if (!strcmp(curdef->name, name)) {
|
2005-01-12 23:57:33 +00:00
|
|
|
return curdef;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2009-11-04 20:50:09 +00:00
|
|
|
int get_named_vertexgroup_num (Object *ob, const char *name)
|
2007-08-17 11:23:48 +00:00
|
|
|
{
|
|
|
|
/* Return the location of the named deform group within the list of
|
|
|
|
* deform groups. This function is a combination of get_defgroup_num and
|
|
|
|
* get_named_vertexgroup. The other two could be called instead, but that
|
|
|
|
* require looping over the vertexgroups twice.
|
|
|
|
*/
|
|
|
|
bDeformGroup *curdef;
|
|
|
|
int def_nr;
|
|
|
|
|
|
|
|
for (curdef=ob->defbase.first, def_nr=0; curdef; curdef=curdef->next, def_nr++) {
|
|
|
|
if (!strcmp(curdef->name, name))
|
|
|
|
return def_nr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int get_defgroup_num (Object *ob, bDeformGroup *dg)
|
2005-01-12 23:57:33 +00:00
|
|
|
{
|
|
|
|
/* Fetch the location of this deform group
|
|
|
|
* within the linked list of deform groups.
|
|
|
|
* (this number is stored in the deform
|
|
|
|
* weights of the deform verts to link them
|
2007-08-17 11:23:48 +00:00
|
|
|
* to this deform group).
|
2010-01-18 16:21:23 +00:00
|
|
|
*
|
|
|
|
* note: this is zero based, ob->actdef starts at 1.
|
2005-01-12 23:57:33 +00:00
|
|
|
*/
|
|
|
|
|
2007-04-27 11:16:35 +00:00
|
|
|
bDeformGroup *eg;
|
2005-01-12 23:57:33 +00:00
|
|
|
int def_nr;
|
|
|
|
|
|
|
|
eg = ob->defbase.first;
|
|
|
|
def_nr = 0;
|
|
|
|
|
2007-08-17 11:23:48 +00:00
|
|
|
/* loop through all deform groups */
|
2007-04-27 11:16:35 +00:00
|
|
|
while (eg != NULL) {
|
2005-01-12 23:57:33 +00:00
|
|
|
|
|
|
|
/* if the current deform group is
|
|
|
|
* the one we are after, return
|
|
|
|
* def_nr
|
|
|
|
*/
|
2007-04-27 11:16:35 +00:00
|
|
|
if (eg == dg) {
|
2005-01-12 23:57:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
++def_nr;
|
|
|
|
eg = eg->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if there was no deform group found then
|
|
|
|
* return -1 (should set up a nice symbolic
|
|
|
|
* constant for this)
|
|
|
|
*/
|
|
|
|
if (eg == NULL) return -1;
|
|
|
|
|
|
|
|
return def_nr;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-01-15 17:28:00 +00:00
|
|
|
/* note, must be freed */
|
|
|
|
int *get_defgroup_flip_map(Object *ob)
|
|
|
|
{
|
|
|
|
bDeformGroup *dg;
|
|
|
|
int totdg= BLI_countlist(&ob->defbase);
|
|
|
|
|
|
|
|
if(totdg==0) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
char name[sizeof(dg->name)];
|
|
|
|
int i, flip_num, *map= MEM_mallocN(totdg * sizeof(int), "get_defgroup_flip_map");
|
|
|
|
memset(map, -1, totdg * sizeof(int));
|
|
|
|
|
|
|
|
for (dg=ob->defbase.first, i=0; dg; dg=dg->next, i++) {
|
|
|
|
if(map[i] == -1) { /* may be calculated previously */
|
|
|
|
flip_vertexgroup_name(name, dg->name, 0);
|
|
|
|
if(strcmp(name, dg->name)) {
|
|
|
|
flip_num= get_named_vertexgroup_num(ob, name);
|
|
|
|
if(flip_num > -1) {
|
|
|
|
map[i]= flip_num;
|
|
|
|
map[flip_num]= i; /* save an extra lookup */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return map;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-04-27 11:16:35 +00:00
|
|
|
void unique_vertexgroup_name (bDeformGroup *dg, Object *ob)
|
|
|
|
{
|
|
|
|
bDeformGroup *curdef;
|
|
|
|
int number;
|
|
|
|
int exists = 0;
|
|
|
|
char tempname[64];
|
|
|
|
char *dot;
|
|
|
|
|
|
|
|
if (!ob)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* See if we are given an empty string */
|
|
|
|
if (dg->name[0] == '\0') {
|
|
|
|
/* give it default name first */
|
|
|
|
strcpy (dg->name, "Group");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* See if we even need to do this */
|
|
|
|
for (curdef = ob->defbase.first; curdef; curdef=curdef->next) {
|
|
|
|
if (dg!=curdef) {
|
|
|
|
if (!strcmp(curdef->name, dg->name)) {
|
|
|
|
exists = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!exists)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Strip off the suffix */
|
|
|
|
dot=strchr(dg->name, '.');
|
|
|
|
if (dot)
|
|
|
|
*dot=0;
|
|
|
|
|
|
|
|
for (number = 1; number <=999; number++) {
|
|
|
|
sprintf (tempname, "%s.%03d", dg->name, number);
|
|
|
|
|
|
|
|
exists = 0;
|
|
|
|
for (curdef=ob->defbase.first; curdef; curdef=curdef->next) {
|
|
|
|
if (dg!=curdef) {
|
|
|
|
if (!strcmp (curdef->name, tempname)) {
|
|
|
|
exists = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!exists) {
|
|
|
|
BLI_strncpy (dg->name, tempname, 32);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-07-04 19:56:31 +00:00
|
|
|
|
2010-01-15 17:28:00 +00:00
|
|
|
|
|
|
|
/* finds the best possible flipped name. For renaming; check for unique names afterwards */
|
|
|
|
/* if strip_number: removes number extensions */
|
2010-01-17 16:00:54 +00:00
|
|
|
void flip_vertexgroup_name (char *name, const char *from_name, int strip_number)
|
2010-01-15 17:28:00 +00:00
|
|
|
{
|
|
|
|
int len;
|
|
|
|
char prefix[sizeof((bDeformGroup *)NULL)->name]={""}; /* The part before the facing */
|
|
|
|
char suffix[sizeof((bDeformGroup *)NULL)->name]={""}; /* The part after the facing */
|
|
|
|
char replace[sizeof((bDeformGroup *)NULL)->name]={""}; /* The replacement string */
|
|
|
|
char number[sizeof((bDeformGroup *)NULL)->name]={""}; /* The number extension string */
|
|
|
|
char *index=NULL;
|
|
|
|
|
2010-01-17 16:00:54 +00:00
|
|
|
len= strlen(from_name);
|
2010-01-15 17:28:00 +00:00
|
|
|
if(len<3) return; // we don't do names like .R or .L
|
|
|
|
|
2010-01-17 16:00:54 +00:00
|
|
|
strcpy(name, from_name);
|
|
|
|
|
2010-01-15 17:28:00 +00:00
|
|
|
/* We first check the case with a .### extension, let's find the last period */
|
|
|
|
if(isdigit(name[len-1])) {
|
|
|
|
index= strrchr(name, '.'); // last occurrence
|
|
|
|
if (index && isdigit(index[1]) ) { // doesnt handle case bone.1abc2 correct..., whatever!
|
|
|
|
if(strip_number==0)
|
|
|
|
strcpy(number, index);
|
|
|
|
*index= 0;
|
|
|
|
len= strlen(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
strcpy (prefix, name);
|
|
|
|
|
|
|
|
#define IS_SEPARATOR(a) ((a)=='.' || (a)==' ' || (a)=='-' || (a)=='_')
|
|
|
|
|
|
|
|
/* first case; separator . - _ with extensions r R l L */
|
|
|
|
if( IS_SEPARATOR(name[len-2]) ) {
|
|
|
|
switch(name[len-1]) {
|
|
|
|
case 'l':
|
|
|
|
prefix[len-1]= 0;
|
|
|
|
strcpy(replace, "r");
|
|
|
|
break;
|
|
|
|
case 'r':
|
|
|
|
prefix[len-1]= 0;
|
|
|
|
strcpy(replace, "l");
|
|
|
|
break;
|
|
|
|
case 'L':
|
|
|
|
prefix[len-1]= 0;
|
|
|
|
strcpy(replace, "R");
|
|
|
|
break;
|
|
|
|
case 'R':
|
|
|
|
prefix[len-1]= 0;
|
|
|
|
strcpy(replace, "L");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* case; beginning with r R l L , with separator after it */
|
|
|
|
else if( IS_SEPARATOR(name[1]) ) {
|
|
|
|
switch(name[0]) {
|
|
|
|
case 'l':
|
|
|
|
strcpy(replace, "r");
|
|
|
|
strcpy(suffix, name+1);
|
|
|
|
prefix[0]= 0;
|
|
|
|
break;
|
|
|
|
case 'r':
|
|
|
|
strcpy(replace, "l");
|
|
|
|
strcpy(suffix, name+1);
|
|
|
|
prefix[0]= 0;
|
|
|
|
break;
|
|
|
|
case 'L':
|
|
|
|
strcpy(replace, "R");
|
|
|
|
strcpy(suffix, name+1);
|
|
|
|
prefix[0]= 0;
|
|
|
|
break;
|
|
|
|
case 'R':
|
|
|
|
strcpy(replace, "L");
|
|
|
|
strcpy(suffix, name+1);
|
|
|
|
prefix[0]= 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(len > 5) {
|
|
|
|
/* hrms, why test for a separator? lets do the rule 'ultimate left or right' */
|
|
|
|
index = BLI_strcasestr(prefix, "right");
|
|
|
|
if (index==prefix || index==prefix+len-5) {
|
|
|
|
if(index[0]=='r')
|
|
|
|
strcpy (replace, "left");
|
|
|
|
else {
|
|
|
|
if(index[1]=='I')
|
|
|
|
strcpy (replace, "LEFT");
|
|
|
|
else
|
|
|
|
strcpy (replace, "Left");
|
|
|
|
}
|
|
|
|
*index= 0;
|
|
|
|
strcpy (suffix, index+5);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
index = BLI_strcasestr(prefix, "left");
|
|
|
|
if (index==prefix || index==prefix+len-4) {
|
|
|
|
if(index[0]=='l')
|
|
|
|
strcpy (replace, "right");
|
|
|
|
else {
|
|
|
|
if(index[1]=='E')
|
|
|
|
strcpy (replace, "RIGHT");
|
|
|
|
else
|
|
|
|
strcpy (replace, "Right");
|
|
|
|
}
|
|
|
|
*index= 0;
|
|
|
|
strcpy (suffix, index+4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef IS_SEPARATOR
|
|
|
|
|
2010-01-17 16:00:54 +00:00
|
|
|
sprintf (name, "%s%s%s%s", prefix, replace, suffix, number);
|
2010-01-15 17:28:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-08-06 15:46:38 +00:00
|
|
|
float deformvert_get_weight(const struct MDeformVert *dvert, int group_num)
|
2008-07-04 19:56:31 +00:00
|
|
|
{
|
|
|
|
if(dvert)
|
|
|
|
{
|
2008-08-06 15:46:38 +00:00
|
|
|
const MDeformWeight *dw = dvert->dw;
|
2008-07-04 19:56:31 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
for(i=dvert->totweight; i>0; i--, dw++)
|
|
|
|
if(dw->def_nr == group_num)
|
|
|
|
return dw->weight;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Not found */
|
|
|
|
return 0.0;
|
|
|
|
}
|
|
|
|
|
2008-08-06 15:46:38 +00:00
|
|
|
float vertexgroup_get_vertex_weight(const struct MDeformVert *dvert, int index, int group_num)
|
2008-07-04 19:56:31 +00:00
|
|
|
{
|
2008-11-03 23:17:36 +00:00
|
|
|
if(group_num == -1 || dvert == NULL)
|
2008-07-04 19:56:31 +00:00
|
|
|
return 1.0;
|
|
|
|
|
|
|
|
return deformvert_get_weight(dvert+index, group_num);
|
|
|
|
}
|
|
|
|
|