svn merge -r 12691:12716 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / src / buttons_object.c
index 1808618d7b73925a7cee307e71ebe92b6a5919cb..e7a2a654ba1f9e21bf719294d2ce068819e72eea 100644 (file)
@@ -208,7 +208,7 @@ static void add_constraint_to_active(Object *ob, bConstraint *con)
 
 /* returns base ID for Ipo, sets actname to channel if appropriate */
 /* should not make action... */
-void get_constraint_ipo_context(void *ob_v, char *actname)
+static void get_constraint_ipo_context(void *ob_v, char *actname)
 {
        Object *ob= ob_v;
        
@@ -240,8 +240,11 @@ static void enable_constraint_ipo_func (void *ob_v, void *con_v)
        get_constraint_ipo_context(ob, actname);
        
        /* adds ipo & channels & curve if needed */
-       verify_ipo((ID *)ob, ID_CO, actname, con->name);
-       
+       if(con->flag & CONSTRAINT_OWN_IPO)
+               verify_ipo((ID *)ob, ID_CO, NULL, con->name, actname);
+       else
+               verify_ipo((ID *)ob, ID_CO, actname, con->name, NULL);
+               
        /* make sure ipowin shows it */
        ob->ipowin= ID_CO;
        allqueue(REDRAWIPO, ID_CO);
@@ -264,8 +267,11 @@ static void add_influence_key_to_constraint_func (void *ob_v, void *con_v)
        get_constraint_ipo_context(ob, actname);
 
        /* adds ipo & channels & curve if needed */
-       icu= verify_ipocurve((ID *)ob, ID_CO, actname, con->name, CO_ENFORCE);
-       
+       if(con->flag & CONSTRAINT_OWN_IPO)
+               icu= verify_ipocurve((ID *)ob, ID_CO, NULL, con->name, actname, CO_ENFORCE);
+       else
+               icu= verify_ipocurve((ID *)ob, ID_CO, actname, con->name, NULL, CO_ENFORCE);
+               
        if (!icu) {
                error("Cannot get a curve from this IPO, may be dealing with linked data");
                return;
@@ -2321,7 +2327,7 @@ static void object_panel_object(Object *ob)
        block= uiNewBlock(&curarea->uiblocks, "object_panel_object", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Object and Links", "Object", 0, 0, 318, 204)==0) return;
        
-       uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+       uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
        
        /* object name */
        uiBlockSetCol(block, TH_BUT_SETTING2);
@@ -2388,7 +2394,7 @@ static void object_panel_anim(Object *ob)
        block= uiNewBlock(&curarea->uiblocks, "object_panel_anim", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Anim settings", "Object", 320, 0, 318, 204)==0) return;
        
-       uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+       uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
        
        uiBlockBeginAlign(block);
        uiDefButS(block, ROW,B_TRACKBUTS,"TrackX",      24,180,59,19, &ob->trackflag, 12.0, 0.0, 0, 0, "Specify the axis that points to another object");
@@ -2453,7 +2459,7 @@ static void object_panel_draw(Object *ob)
        block= uiNewBlock(&curarea->uiblocks, "object_panel_draw", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Draw", "Object", 640, 0, 318, 204)==0) return;
        
-       uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+       uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
        
        /* LAYERS */
        xco= 120;
@@ -2515,7 +2521,7 @@ void object_panel_constraint(char *context)
        block= uiNewBlock(&curarea->uiblocks, "object_panel_constraint", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Constraints", context, 960, 0, 318, 204)==0) return;
        
-       uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+       uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
        
        /* this is a variable height panel, newpanel doesnt force new size on existing panels */
        /* so first we make it default height */