Using Nkey in 3d window, you could create a parent-loop, which hangs
Blender.
Added here that it checks loops, as for normal CTRL+P parenting.
This commit is contained in:
Ton Roosendaal
2004-04-06 19:16:14 +00:00
parent f2c7434c78
commit c8fadc65dc
2 changed files with 12 additions and 5 deletions

View File

@@ -127,10 +127,11 @@ void butspace_context_switch(SpaceButs *buts, struct Base *new);
#define B_BGPICCLEAR 1005
#define B_BGPICTEXCLEAR 1006
#define B_OBJECTPANELROT 1007
#define B_OBJECTPANELROT 1007
#define B_OBJECTPANELMEDIAN 1008
#define B_ARMATUREPANEL1 1009
#define B_ARMATUREPANEL2 1010
#define B_OBJECTPANELPARENT 1011
/* *********************** */
#define B_LAMPBUTS 1200

View File

@@ -106,6 +106,7 @@
#include "BDR_drawmesh.h"
#include "BDR_drawobject.h"
#include "BDR_editobject.h"
#include "BSE_view.h"
#include "BSE_drawview.h"
@@ -1352,7 +1353,7 @@ void do_viewbuts(unsigned short event)
allqueue(REDRAWVIEW3D, 1);
}
break;
case B_OBJECTPANELMEDIAN:
if(ob) {
v3d_editvertex_buts(NULL, ob, 1.0);
@@ -1360,6 +1361,13 @@ void do_viewbuts(unsigned short event)
allqueue(REDRAWVIEW3D, 1);
}
break;
case B_OBJECTPANELPARENT:
if(ob) {
if( test_parent_loop(ob->parent, ob) )
ob->parent= NULL;
allqueue(REDRAWVIEW3D, 1);
}
break;
case B_ARMATUREPANEL1:
{
@@ -1433,7 +1441,7 @@ static void view3d_panel_object(short cntrl) // VIEW3D_HANDLER_OBJECT
if(uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 204)==0) return;
uiDefBut(block, TEX, B_IDNAME, "OB: ", 10,180,140,20, ob->id.name+2, 0.0, 18.0, 0, 0, "");
uiDefIDPoinBut(block, test_obpoin_but, B_REDR, "Par:", 160, 180, 140, 20, &ob->parent, "Parent Object");
uiDefIDPoinBut(block, test_obpoin_but, B_OBJECTPANELPARENT, "Par:", 160, 180, 140, 20, &ob->parent, "Parent Object");
lim= 1000.0*MAX2(1.0, G.vd->grid);
@@ -2356,7 +2364,6 @@ void inner_play_anim_loop(int init, int mode)
static ScrArea *oldsa;
static double swaptime;
static int curmode;
Base *base;
/* init */
if(init) {
@@ -2422,7 +2429,6 @@ int play_anim(int mode)
int cfraont;
unsigned short event=0;
short val;
Base *base;
/* patch for very very old scenes */
if(SFRA==0) SFRA= 1;