Another merger of Orange branch with bf-blender, it has important fixes.
This commit is contained in:
@@ -1416,6 +1416,7 @@ static void lib_link_pose(FileData *fd, Object *ob, bPose *pose)
|
||||
{
|
||||
bPoseChannel *pchan;
|
||||
bArmature *arm= ob->data;
|
||||
int rebuild= 0;
|
||||
if (!pose)
|
||||
return;
|
||||
|
||||
@@ -1424,6 +1425,12 @@ static void lib_link_pose(FileData *fd, Object *ob, bPose *pose)
|
||||
// hurms... loop in a loop, but yah... later... (ton)
|
||||
pchan->bone= get_named_bone(arm, pchan->name);
|
||||
pchan->custom= newlibadr(fd, arm->id.lib, pchan->custom);
|
||||
if(pchan->bone==NULL)
|
||||
rebuild= 1;
|
||||
}
|
||||
if(rebuild) {
|
||||
ob->recalc= OB_RECALC;
|
||||
pose->flag |= POSE_RECALC;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ extern void countall(void);
|
||||
static PyObject *g_nmeshmodule = NULL;
|
||||
|
||||
static int unlink_existingMeshData( Mesh * mesh );
|
||||
static int convert_NMeshToMesh( Mesh *mesh, BPy_NMesh *nmesh, int store_edges );
|
||||
static int convert_NMeshToMesh( Mesh *mesh, BPy_NMesh *nmesh );
|
||||
static void check_dverts(Mesh *me, int old_totverts);
|
||||
static PyObject *NMesh_printDebug( PyObject * self );
|
||||
static PyObject *NMesh_addEdge( PyObject * self, PyObject * args );
|
||||
@@ -1330,11 +1330,11 @@ static PyObject *NMesh_update( PyObject *self, PyObject *a, PyObject *kwd )
|
||||
if( mesh ) {
|
||||
old_totvert = mesh->totvert;
|
||||
unlink_existingMeshData( mesh );
|
||||
if( !convert_NMeshToMesh( mesh, nmesh, store_edges ) )
|
||||
if( !convert_NMeshToMesh( mesh, nmesh ) )
|
||||
return NULL;
|
||||
if (mesh->dvert) check_dverts(mesh, old_totvert);
|
||||
} else {
|
||||
mesh = Mesh_fromNMesh( nmesh, store_edges );
|
||||
mesh = Mesh_fromNMesh( nmesh );
|
||||
/* if mesh is NULL, there was an error */
|
||||
if( !mesh )
|
||||
return NULL;
|
||||
@@ -1461,7 +1461,7 @@ static PyObject *NMesh_getVertexInfluences( PyObject * self, PyObject * args )
|
||||
return influence_list;
|
||||
}
|
||||
|
||||
Mesh *Mesh_fromNMesh( BPy_NMesh * nmesh , int store_edges )
|
||||
Mesh *Mesh_fromNMesh( BPy_NMesh * nmesh )
|
||||
{
|
||||
Mesh *mesh = NULL;
|
||||
|
||||
@@ -1476,7 +1476,7 @@ Mesh *Mesh_fromNMesh( BPy_NMesh * nmesh , int store_edges )
|
||||
mesh->id.us = 0; /* no user yet */
|
||||
G.totmesh++;
|
||||
|
||||
if( !convert_NMeshToMesh( mesh, nmesh, store_edges ) )
|
||||
if( !convert_NMeshToMesh( mesh, nmesh ) )
|
||||
return NULL;
|
||||
|
||||
return mesh;
|
||||
@@ -2890,6 +2890,14 @@ static void fill_medge_from_nmesh(Mesh * mesh, BPy_NMesh * nmesh)
|
||||
}
|
||||
}
|
||||
|
||||
/* tot_valid_faces_edges < 0 causes a sigsegv crash, so we
|
||||
* clamp to prevent it
|
||||
* (this is related to faces (correctly) requiring at least 3 verts now,
|
||||
* which can break old scripts -- maybe we should also warn about the
|
||||
* 'broken' mesh the user created, but for now, until we investigate
|
||||
* better, this should do) */
|
||||
if (tot_valid_faces_edges < 0) tot_valid_faces_edges = 0;
|
||||
|
||||
/* Now we have the total count of valid edges */
|
||||
mesh->totedge=tot_valid_nmedges+tot_valid_faces_edges;
|
||||
mesh->medge=MEM_callocN(mesh->totedge*sizeof(MEdge), "make mesh edges");
|
||||
@@ -2955,7 +2963,7 @@ static void check_dverts(Mesh *me, int old_totvert)
|
||||
return;
|
||||
}
|
||||
|
||||
static int convert_NMeshToMesh( Mesh * mesh, BPy_NMesh * nmesh, int store_edges)
|
||||
static int convert_NMeshToMesh( Mesh * mesh, BPy_NMesh * nmesh)
|
||||
{
|
||||
MFace *newmf;
|
||||
TFace *newtf;
|
||||
@@ -3183,7 +3191,7 @@ static PyObject *M_NMesh_PutRaw( PyObject * self, PyObject * args )
|
||||
old_totvert = mesh->totvert;
|
||||
|
||||
unlink_existingMeshData( mesh );
|
||||
if( !convert_NMeshToMesh( mesh, nmesh, store_edges ) )
|
||||
if( !convert_NMeshToMesh( mesh, nmesh ) )
|
||||
return NULL;
|
||||
nmesh->mesh = mesh;
|
||||
|
||||
@@ -3414,7 +3422,7 @@ Mesh *NMesh_FromPyObject( PyObject * pyobj, Object * ob )
|
||||
if( nmesh->mesh ) {
|
||||
mesh = nmesh->mesh;
|
||||
} else {
|
||||
mesh = Mesh_fromNMesh( nmesh, 1 );
|
||||
mesh = Mesh_fromNMesh( nmesh );
|
||||
if( !mesh ) /* NULL means an PyError */
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ int NMesh_CheckPyObject( PyObject * pyobj );
|
||||
|
||||
void mesh_update( Mesh * mesh , Object * ob );
|
||||
PyObject *new_NMesh( Mesh * oldmesh );
|
||||
Mesh *Mesh_fromNMesh( BPy_NMesh * nmesh , int store_edges );
|
||||
Mesh *Mesh_fromNMesh( BPy_NMesh * nmesh );
|
||||
PyObject *NMesh_assignMaterials_toObject( BPy_NMesh * nmesh, Object * ob );
|
||||
Material **nmesh_updateMaterials( BPy_NMesh * nmesh );
|
||||
Material **newMaterialList_fromPyList( PyObject * list );
|
||||
|
||||
@@ -188,7 +188,7 @@ def PutRaw(nmesh, name = None, recalc_normals = 1, store_edges = 0):
|
||||
this nmesh data. It can be an existing mesh data object or a new one.
|
||||
@param recalc_normals: If non-zero, the vertex normals for the mesh will
|
||||
be recalculated.
|
||||
@param store_edges: if non-zero, the edges data are stored
|
||||
@param store_edges: deprecated, edges are always stored now.
|
||||
@rtype: None or Object
|
||||
@return: It depends on the 'name' parameter:
|
||||
- I{name} refers to an existing mesh data obj already linked to an
|
||||
@@ -587,7 +587,7 @@ class NMesh:
|
||||
@type recalc_normals: int (bool)
|
||||
@param recalc_normals: if nonzero the vertex normals are recalculated.
|
||||
@type store_edges: int (bool)
|
||||
@param store_edges: if nonzero, then edge data is stored.
|
||||
@param store_edges: deprecated, edges are always stored now.
|
||||
@type vertex_shade: int (bool)
|
||||
@param vertex_shade: if nonzero vertices are colored based on the
|
||||
current lighting setup, like when there are no vertex colors and no
|
||||
|
||||
@@ -983,7 +983,7 @@ void delete_nlachannel_keys(void)
|
||||
bConstraintChannel *conchan;
|
||||
bActionStrip *strip, *nextstrip;
|
||||
|
||||
if (!okee("Erase selected keys"))
|
||||
if (!okee("Erase selected strips and/or keys"))
|
||||
return;
|
||||
|
||||
for (base = G.scene->base.first; base; base=base->next){
|
||||
|
||||
@@ -157,6 +157,9 @@ void do_layer_buttons(short event)
|
||||
|
||||
if(G.vd->scenelock) handle_view3d_lock();
|
||||
scrarea_queue_winredraw(curarea);
|
||||
|
||||
/* new layers might need unflushed events events */
|
||||
DAG_scene_update_flags(G.scene, G.vd->lay); // tags all that moves and flushes
|
||||
}
|
||||
else {
|
||||
if(G.qual & LR_ALTKEY) {
|
||||
|
||||
Reference in New Issue
Block a user