- Object buttons, Hooks panel, clear offset didn't redraw correct
- Particle panel was drawing in wrong size
This commit is contained in:
@@ -242,65 +242,6 @@ Bone *get_named_bone (bArmature *arm, const char *name)
|
||||
return bone;
|
||||
}
|
||||
|
||||
/* ****************** Game Blender functions, called by engine ************** */
|
||||
|
||||
void GB_build_mats (float parmat[][4], float obmat[][4], float premat[][4], float postmat[][4])
|
||||
{
|
||||
float obinv[4][4];
|
||||
|
||||
Mat4Invert(obinv, obmat);
|
||||
Mat4CpyMat4(premat, obmat);
|
||||
Mat4MulMat4(postmat, parmat, obinv);
|
||||
|
||||
Mat4Invert (premat, postmat);
|
||||
}
|
||||
|
||||
void GB_init_armature_deform(ListBase *defbase, float premat[][4], float postmat[][4])
|
||||
{
|
||||
g_defbase = defbase;
|
||||
Mat4CpyMat4 (g_premat, premat);
|
||||
Mat4CpyMat4 (g_postmat, postmat);
|
||||
|
||||
}
|
||||
|
||||
void GB_validate_defgroups (Mesh *mesh, ListBase *defbase)
|
||||
{
|
||||
/* Should only be called when the mesh or armature changes */
|
||||
int j, i;
|
||||
MDeformVert *dvert;
|
||||
|
||||
for (j=0; j<mesh->totvert; j++){
|
||||
dvert = mesh->dvert+j;
|
||||
for (i=0; i<dvert->totweight; i++)
|
||||
dvert->dw[i].data = ((bDeformGroup*)BLI_findlink (defbase, dvert->dw[i].def_nr))->data;
|
||||
}
|
||||
}
|
||||
|
||||
void GB_calc_armature_deform (float *co, MDeformVert *dvert)
|
||||
{
|
||||
float vec[3]={0, 0, 0};
|
||||
float contrib = 0;
|
||||
int i;
|
||||
Bone *bone;
|
||||
|
||||
Mat4MulVecfl(g_premat, co);
|
||||
|
||||
for (i=0; i<dvert->totweight; i++){
|
||||
bone = dvert->dw[i].data;
|
||||
// if (bone) calc_bone_deform (bone, dvert->dw[i].weight, vec, co, &contrib);
|
||||
}
|
||||
|
||||
if (contrib){
|
||||
vec[0]/=contrib;
|
||||
vec[1]/=contrib;
|
||||
vec[2]/=contrib;
|
||||
}
|
||||
|
||||
VecAddf (co, vec, co);
|
||||
Mat4MulVecfl(g_postmat, co);
|
||||
}
|
||||
|
||||
/* ****************** END Game Blender functions, called by engine ************** */
|
||||
/* ************ Armature Deform ******************* */
|
||||
|
||||
void init_armature_deform(Object *parent, Object *ob)
|
||||
@@ -1069,3 +1010,64 @@ Bone *get_indexed_bone (Object *ob, int index)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* ****************** Game Blender functions, called by engine ************** */
|
||||
|
||||
void GB_build_mats (float parmat[][4], float obmat[][4], float premat[][4], float postmat[][4])
|
||||
{
|
||||
float obinv[4][4];
|
||||
|
||||
Mat4Invert(obinv, obmat);
|
||||
Mat4CpyMat4(premat, obmat);
|
||||
Mat4MulMat4(postmat, parmat, obinv);
|
||||
|
||||
Mat4Invert (premat, postmat);
|
||||
}
|
||||
|
||||
void GB_init_armature_deform(ListBase *defbase, float premat[][4], float postmat[][4])
|
||||
{
|
||||
g_defbase = defbase;
|
||||
Mat4CpyMat4 (g_premat, premat);
|
||||
Mat4CpyMat4 (g_postmat, postmat);
|
||||
|
||||
}
|
||||
|
||||
void GB_validate_defgroups (Mesh *mesh, ListBase *defbase)
|
||||
{
|
||||
/* Should only be called when the mesh or armature changes */
|
||||
int j, i;
|
||||
MDeformVert *dvert;
|
||||
|
||||
for (j=0; j<mesh->totvert; j++){
|
||||
dvert = mesh->dvert+j;
|
||||
for (i=0; i<dvert->totweight; i++)
|
||||
dvert->dw[i].data = ((bDeformGroup*)BLI_findlink (defbase, dvert->dw[i].def_nr))->data;
|
||||
}
|
||||
}
|
||||
|
||||
void GB_calc_armature_deform (float *co, MDeformVert *dvert)
|
||||
{
|
||||
float vec[3]={0, 0, 0};
|
||||
float contrib = 0;
|
||||
int i;
|
||||
// bPoseChannel *pchan;
|
||||
|
||||
Mat4MulVecfl(g_premat, co);
|
||||
|
||||
for (i=0; i<dvert->totweight; i++){
|
||||
// pchan = (bPoseChannel *)dvert->dw[i].data;
|
||||
// if (pchan) calc_bone_deform (pchan, dvert->dw[i].weight, vec, co, &contrib);
|
||||
}
|
||||
|
||||
if (contrib){
|
||||
vec[0]/=contrib;
|
||||
vec[1]/=contrib;
|
||||
vec[2]/=contrib;
|
||||
}
|
||||
|
||||
VecAddf (co, vec, co);
|
||||
Mat4MulVecfl(g_postmat, co);
|
||||
}
|
||||
|
||||
/* ****************** END Game Blender functions, called by engine ************** */
|
||||
|
||||
|
||||
@@ -1164,6 +1164,7 @@ void do_object_panels(unsigned short event)
|
||||
/* apparently this call goes from right to left... */
|
||||
Mat4MulSerie(hook->parentinv, hook->parent->imat, ob->obmat, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
|
||||
BIF_undo_push("Clear hook");
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
}
|
||||
@@ -1647,7 +1648,7 @@ void object_panel_effects(Object *ob)
|
||||
|
||||
block= uiNewBlock(&curarea->uiblocks, "object_panel_effects", UI_EMBOSS, UI_HELV, curarea->win);
|
||||
uiNewPanelTabbed("Constraints", "Object");
|
||||
if(uiNewPanel(curarea, block, "Effects", "Object", 640, 0, 318, 204)==0) return;
|
||||
if(uiNewPanel(curarea, block, "Effects", "Object", 640, 0, 418, 204)==0) return;
|
||||
|
||||
/* EFFECTS */
|
||||
|
||||
|
||||
@@ -655,7 +655,7 @@ void add_hook(void)
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
allqueue(REDRAWBUTSOBJECT, 0);
|
||||
DAG_scene_sort(G.scene);
|
||||
|
||||
|
||||
BIF_undo_push("Add hook");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user