Added a python hook to Joining objects
Object.Join() Seperated the join calls from space.c and view3dmenu into join_menu() in space.c, like the select_group_menu(), okee's from join_curve, join_mesh.. etc are in join_menu() so python can call them without UI menu's in the way. this is also a bit neater since there were 2 places that were doing what join_menu() does now. - Cam
This commit is contained in:
@@ -598,6 +598,27 @@ void select_group_menu(void)
|
||||
select_group(nr);
|
||||
}
|
||||
|
||||
void join_menu(void)
|
||||
{
|
||||
Object *ob= OBACT;
|
||||
if (ob && !G.obedit) {
|
||||
if(ob->type == OB_MESH) {
|
||||
if(okee("Join selected meshes")==0) return;
|
||||
join_mesh();
|
||||
} else if(ob->type == OB_CURVE) {
|
||||
if(okee("Join selected curves")==0) return;
|
||||
join_curve(OB_CURVE);
|
||||
} else if(ob->type == OB_SURF) {
|
||||
if(okee("Join selected NURBS")==0) return;
|
||||
join_curve(OB_SURF);
|
||||
} else if(ob->type == OB_ARMATURE) {
|
||||
/* Make sure the user wants to continue*/
|
||||
if(okee("Join selected armatures")==0) return;
|
||||
join_armature ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void select_group(short nr)
|
||||
{
|
||||
Base *base;
|
||||
@@ -623,6 +644,11 @@ void select_group(short nr)
|
||||
allqueue(REDRAWIPO, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static unsigned short convert_for_nonumpad(unsigned short event)
|
||||
{
|
||||
if (event>=ZEROKEY && event<=NINEKEY) {
|
||||
@@ -1366,14 +1392,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
case JKEY:
|
||||
if(G.qual==LR_CTRLKEY) {
|
||||
if( ob ) {
|
||||
if(ob->type == OB_MESH)
|
||||
join_mesh();
|
||||
else if(ob->type == OB_CURVE)
|
||||
join_curve(OB_CURVE);
|
||||
else if(ob->type == OB_SURF)
|
||||
join_curve(OB_SURF);
|
||||
else if(ob->type == OB_ARMATURE)
|
||||
join_armature ();
|
||||
join_menu();
|
||||
}
|
||||
else if ((G.obedit) && ELEM(G.obedit->type, OB_CURVE, OB_SURF))
|
||||
addsegment_nurb();
|
||||
|
||||
Reference in New Issue
Block a user