Rename Scene macros back to their original _NEW less names

This commit is contained in:
Dalai Felinto 2017-11-09 13:23:01 -02:00
parent c35f1d05ea
commit cec7f1215a
59 changed files with 200 additions and 200 deletions

View File

@ -500,7 +500,7 @@ static int surface_getBrushFlags(DynamicPaintSurface *surface, const SceneLayer
if (surface->brush_group)
go = surface->brush_group->gobject.first;
else
base = FIRSTBASE_NEW(sl);
base = FIRSTBASE(sl);
while (base || go) {
brushObj = NULL;
@ -5793,7 +5793,7 @@ static int dynamicPaint_doStep(const struct EvaluationContext *eval_ctx, Scene *
if (surface->brush_group)
go = surface->brush_group->gobject.first;
else
base = FIRSTBASE_NEW(sl);
base = FIRSTBASE(sl);
while (base || go) {
brushObj = NULL;

View File

@ -244,7 +244,7 @@ ListBase *pdInitEffectors(
}
}
else {
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
for (base = FIRSTBASE(sl); base; base = base->next) {
if ( base->object->pd && base->object->pd->forcefield )
add_object_to_effectors(&effectors, eval_ctx, scene, weights, base->object, ob_src, for_simulation);

View File

@ -866,7 +866,7 @@ static LodLevel *lod_level_select(Object *ob, const float camera_position[3])
bool BKE_object_lod_is_usable(Object *ob, SceneLayer *sl)
{
bool active = (sl) ? ob == OBACT_NEW(sl) : false;
bool active = (sl) ? ob == OBACT(sl) : false;
return (ob->mode == OB_MODE_OBJECT || !active);
}
@ -2572,7 +2572,7 @@ void BKE_scene_foreach_display_point(
Base *base;
Object *ob;
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
for (base = FIRSTBASE(sl); base; base = base->next) {
if (((base->flag & BASE_VISIBLED) != 0) && ((base->flag & BASE_SELECTED) != 0)) {
ob = base->object;
@ -3389,8 +3389,8 @@ LinkNode *BKE_object_relational_superset(struct SceneLayer *scene_layer, eObject
obrel_list_add(&links, ob);
}
else {
if ((objectSet == OB_SET_SELECTED && TESTBASELIB_BGMODE_NEW(base)) ||
(objectSet == OB_SET_VISIBLE && BASE_EDITABLE_BGMODE_NEW(base)))
if ((objectSet == OB_SET_SELECTED && TESTBASELIB_BGMODE(base)) ||
(objectSet == OB_SET_VISIBLE && BASE_EDITABLE_BGMODE(base)))
{
Object *ob = base->object;
@ -3420,7 +3420,7 @@ LinkNode *BKE_object_relational_superset(struct SceneLayer *scene_layer, eObject
if (includeFilter & (OB_REL_CHILDREN | OB_REL_CHILDREN_RECURSIVE)) {
Base *local_base;
for (local_base = scene_layer->object_bases.first; local_base; local_base = local_base->next) {
if (BASE_EDITABLE_BGMODE_NEW(local_base)) {
if (BASE_EDITABLE_BGMODE(local_base)) {
Object *child = local_base->object;
if (obrel_list_test(child)) {

View File

@ -272,7 +272,7 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons
/* Now we handle the syncing for visibility, selectability, ... */
layer_collections_sync_flags(&sl_dst->layer_collections, &sl_src->layer_collections);
Object *active_ob = OBACT_NEW(sl_src);
Object *active_ob = OBACT(sl_src);
for (Base *base_src = sl_src->object_bases.first, *base_dst = sl_dst->object_bases.first;
base_src;
base_src = base_src->next, base_dst = base_dst->next)

View File

@ -704,7 +704,7 @@ static int get_lamp(SceneLayer *sl, float *light)
int found_lamp = 0;
// try to find a lamp, preferably local
for (base_tmp = FIRSTBASE_NEW(sl); base_tmp; base_tmp = base_tmp->next) {
for (base_tmp = FIRSTBASE(sl); base_tmp; base_tmp = base_tmp->next) {
if (base_tmp->object->type == OB_LAMP) {
Lamp *la = base_tmp->object->data;

View File

@ -532,7 +532,7 @@ static void ccd_build_deflector_hash(SceneLayer *sl, Group *group, Object *verte
}
}
else {
for (Base *base = FIRSTBASE_NEW(sl); base; base = base->next) {
for (Base *base = FIRSTBASE(sl); base; base = base->next) {
/*Only proceed for mesh object in same layer */
if (base->object->type == OB_MESH) {
ob = base->object;
@ -578,7 +578,7 @@ static void ccd_update_deflector_hash(SceneLayer *sl, Group *group, Object *vert
}
}
else {
for (Base *base = FIRSTBASE_NEW(sl); base; base = base->next) {
for (Base *base = FIRSTBASE(sl); base; base = base->next) {
/*Only proceed for mesh object in same layer */
if (base->object->type == OB_MESH) {
ob = base->object;
@ -988,7 +988,7 @@ static bool are_there_deflectors(SceneLayer *sl, Group *group)
}
}
else {
for (Base *base = FIRSTBASE_NEW(sl); base; base = base->next) {
for (Base *base = FIRSTBASE(sl); base; base = base->next) {
if (base->object->pd) {
if (base->object->pd->deflect)
return 1;

View File

@ -441,7 +441,7 @@ typedef struct DRWContextState {
struct SceneLayer *scene_layer; /* 'CTX_data_scene_layer(C)' */
/* Use 'scene->obedit' for edit-mode */
struct Object *obact; /* 'OBACT_NEW' */
struct Object *obact; /* 'OBACT' */
struct RenderEngineType *engine;

View File

@ -3049,7 +3049,7 @@ static void DRW_engines_enable_external(void)
static void DRW_engines_enable(const Scene *scene, SceneLayer *scene_layer, RenderEngineType *engine)
{
Object *obact = OBACT_NEW(scene_layer);
Object *obact = OBACT(scene_layer);
const int mode = CTX_data_mode_enum_ex(scene->obedit, obact);
DRW_engines_enable_from_engine(engine);
@ -3224,7 +3224,7 @@ void DRW_notify_view_update(const bContext *C)
DST.viewport = rv3d->viewport;
DST.draw_ctx = (DRWContextState){
ar, rv3d, v3d, scene, scene_layer, OBACT_NEW(scene_layer), engine, C,
ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine, C,
};
DRW_engines_enable(scene, scene_layer, engine);
@ -3288,7 +3288,7 @@ void DRW_draw_render_loop_ex(
GPU_viewport_engines_data_validate(DST.viewport, DRW_engines_get_hash());
DST.draw_ctx = (DRWContextState){
ar, rv3d, v3d, scene, scene_layer, OBACT_NEW(scene_layer), engine,
ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine,
/* reuse if caller sets */
DST.draw_ctx.evil_C,
@ -3503,7 +3503,7 @@ void DRW_draw_select_loop(
/* Instead of 'DRW_context_state_init(C, &DST.draw_ctx)', assign from args */
DST.draw_ctx = (DRWContextState){
ar, rv3d, v3d, scene, scene_layer, OBACT_NEW(scene_layer), engine, (bContext *)NULL,
ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine, (bContext *)NULL,
};
DRW_viewport_var_init();
@ -3600,7 +3600,7 @@ void DRW_draw_depth_loop(
/* Instead of 'DRW_context_state_init(C, &DST.draw_ctx)', assign from args */
DST.draw_ctx = (DRWContextState){
ar, rv3d, v3d, scene, scene_layer, OBACT_NEW(scene_layer), engine, (bContext *)NULL,
ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine, (bContext *)NULL,
};
DRW_viewport_var_init();

View File

@ -613,7 +613,7 @@ void DRW_draw_background(void)
static bool is_cursor_visible(Scene *scene, SceneLayer *scene_layer)
{
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
/* don't draw cursor in paint modes, but with a few exceptions */
if (ob && ob->mode & OB_MODE_ALL_PAINT) {

View File

@ -1633,7 +1633,7 @@ static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob, Scene
const bool is_library = ob->id.us > 1 || ID_IS_LINKED(ob);
DRWShadingGroup *shgroup;
if (ob == OBACT_NEW(scene_layer)) {
if (ob == OBACT(scene_layer)) {
shgroup = stl->g_data->center_active;
}
else if (ob->base_flag & BASE_SELECTED) {

View File

@ -136,7 +136,7 @@ static Key *actedit_get_shapekeys(bAnimContext *ac)
Object *ob;
Key *key;
ob = OBACT_NEW(sl);
ob = OBACT(sl);
if (ob == NULL)
return NULL;

View File

@ -146,7 +146,7 @@ bool ED_do_pose_selectbuffer(
/* if the bone cannot be affected, don't do anything */
if ((nearBone) && !(nearBone->flag & BONE_UNSELECTABLE)) {
Object *ob_act = OBACT_NEW(sl);
Object *ob_act = OBACT(sl);
bArmature *arm = ob->data;
/* since we do unified select, we don't shift+select a bone if the

View File

@ -212,7 +212,7 @@ bGPdata *ED_gpencil_data_get_active_v3d(Scene *scene, SceneLayer *scene_layer)
* to be consistent with ED_gpencil_data_get_active's behavior.
*/
if (base && TESTBASE_NEW(base)) {
if (base && TESTBASE(base)) {
gpd = base->object->gpd;
}
return gpd ? gpd : scene->gpd;

View File

@ -2031,11 +2031,11 @@ static int convert_exec(bContext *C, wmOperator *op)
if (basact) {
/* active base was changed */
ED_object_base_activate(C, basact);
BASACT_NEW(sl) = basact;
BASACT(sl) = basact;
}
else if (BASACT_NEW(sl)->object->flag & OB_DONE) {
WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, BASACT_NEW(sl)->object);
WM_event_add_notifier(C, NC_OBJECT | ND_DATA, BASACT_NEW(sl)->object);
else if (BASACT(sl)->object->flag & OB_DONE) {
WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, BASACT(sl)->object);
WM_event_add_notifier(C, NC_OBJECT | ND_DATA, BASACT(sl)->object);
}
DEG_relations_tag_update(bmain);
@ -2373,7 +2373,7 @@ static int duplicate_exec(bContext *C, wmOperator *op)
}
/* new object becomes active */
if (BASACT_NEW(sl) == base)
if (BASACT(sl) == base)
ED_object_base_activate(C, basen);
if (basen->object->data) {

View File

@ -625,7 +625,7 @@ static void init_bake_internal(BakeRender *bkr, bContext *C)
bkr->sa = sc ? BKE_screen_find_big_area(sc, SPACE_IMAGE, 10) : NULL; /* can be NULL */
bkr->main = CTX_data_main(C);
bkr->scene = scene;
bkr->actob = (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT_NEW(sl) : NULL;
bkr->actob = (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT(sl) : NULL;
bkr->re = RE_NewRender("_Bake View_");
if (scene->r.bake_mode == RE_BAKE_AO) {
@ -858,7 +858,7 @@ static int bake_image_exec(bContext *C, wmOperator *op)
RE_test_break_cb(bkr.re, NULL, thread_break);
G.is_break = false; /* BKE_blender_test_break uses this global */
RE_Database_Baking(bkr.re, bmain, scene, scene->lay, scene->r.bake_mode, (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT_NEW(sl) : NULL);
RE_Database_Baking(bkr.re, bmain, scene, scene->lay, scene->r.bake_mode, (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT(sl) : NULL);
/* baking itself is threaded, cannot use test_break in threads */
BLI_init_threads(&threads, do_bake_render, 1);

View File

@ -1689,14 +1689,14 @@ static bool get_new_constraint_target(bContext *C, int con_type, Object **tar_ob
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
SceneLayer *sl = CTX_data_scene_layer(C);
Base *base = BASACT_NEW(sl), *newbase = NULL;
Base *base = BASACT(sl), *newbase = NULL;
Object *obt;
/* add new target object */
obt = BKE_object_add(bmain, scene, sl, OB_EMPTY, NULL);
/* set layers OK */
newbase = BASACT_NEW(sl);
newbase = BASACT(sl);
newbase->lay = base->lay;
obt->lay = newbase->lay;
@ -1715,7 +1715,7 @@ static bool get_new_constraint_target(bContext *C, int con_type, Object **tar_ob
}
/* restore, BKE_object_add sets active */
BASACT_NEW(sl) = base;
BASACT(sl) = base;
base->flag |= BASE_SELECTED;
/* make our new target the new object */

View File

@ -545,8 +545,8 @@ static void copymenu_properties(SceneLayer *sl, Object *ob)
nr = pupmenu(str);
if (nr == 1 || nr == 2) {
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
if ((base != BASACT_NEW(sl)) && (TESTBASELIB_NEW(base))) {
for (base = FIRSTBASE(sl); base; base = base->next) {
if ((base != BASACT(sl)) && (TESTBASELIB(base))) {
if (nr == 1) { /* replace */
BKE_bproperty_copy_list(&base->object->prop, &ob->prop);
}
@ -562,8 +562,8 @@ static void copymenu_properties(SceneLayer *sl, Object *ob)
prop = BLI_findlink(&ob->prop, nr - 4); /* account for first 3 menu items & menu index starting at 1*/
if (prop) {
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
if ((base != BASACT_NEW(sl)) && (TESTBASELIB_NEW(base))) {
for (base = FIRSTBASE(sl); base; base = base->next) {
if ((base != BASACT(sl)) && (TESTBASELIB(base))) {
BKE_bproperty_object_set(base->object, prop);
}
}
@ -578,9 +578,9 @@ static void copymenu_logicbricks(SceneLayer *sl, Object *ob)
//XXX no longer used - to be removed - replaced by logicbricks_copy_exec
Base *base;
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
for (base = FIRSTBASE(sl); base; base = base->next) {
if (base->object != ob) {
if (TESTBASELIB_NEW(base)) {
if (TESTBASELIB(base)) {
/* first: free all logic */
free_sensors(&base->object->sensors);
@ -669,7 +669,7 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event)
if (ID_IS_LINKED(scene)) return;
if (!(ob = OBACT_NEW(sl))) return;
if (!(ob = OBACT(sl))) return;
if (scene->obedit) { // XXX get from context
/* obedit_copymenu(); */
@ -689,9 +689,9 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event)
return;
}
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
if (base != BASACT_NEW(sl)) {
if (TESTBASELIB_NEW(base)) {
for (base = FIRSTBASE(sl); base; base = base->next) {
if (base != BASACT(sl)) {
if (TESTBASELIB(base)) {
DEG_id_tag_update(&base->object->id, OB_RECALC_DATA);
if (event == 1) { /* loc */
@ -916,7 +916,7 @@ static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, SceneLay
short event;
char str[512];
if (!(ob = OBACT_NEW(sl))) return;
if (!(ob = OBACT(sl))) return;
if (scene->obedit) { /* XXX get from context */
/* if (ob->type == OB_MESH) */
@ -1344,8 +1344,8 @@ static void UNUSED_FUNCTION(image_aspect) (Scene *scene, SceneLayer *sl)
if (scene->obedit) return; // XXX get from context
if (ID_IS_LINKED(scene)) return;
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
if (TESTBASELIB_NEW(base)) {
for (base = FIRSTBASE(sl); base; base = base->next) {
if (TESTBASELIB(base)) {
ob = base->object;
done = false;

View File

@ -201,7 +201,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
SceneLayer *sl = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
int single_group_index = RNA_enum_get(op->ptr, "group");
Group *single_group = group_object_active_find_index(ob, single_group_index);
Group *group;

View File

@ -247,7 +247,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
else {
Object workob;
ob->parent = BASACT_NEW(sl)->object;
ob->parent = BASACT(sl)->object;
if (v3) {
ob->partype = PARVERT3;
ob->par1 = v1 - 1;

View File

@ -404,7 +404,7 @@ static int object_select_linked_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
}
ob = OBACT_NEW(sl);
ob = OBACT(sl);
if (ob == NULL) {
BKE_report(op->reports, RPT_ERROR, "No active object");
return OPERATOR_CANCELLED;
@ -559,7 +559,7 @@ static bool select_grouped_parent(bContext *C) /* Makes parent active and de-sel
baspar = BKE_scene_layer_base_find(sl, basact->object->parent);
/* can be NULL if parent in other scene */
if (baspar && BASE_SELECTABLE_NEW(baspar)) {
if (baspar && BASE_SELECTABLE(baspar)) {
ED_object_base_select(baspar, BA_SELECT);
ED_object_base_activate(C, baspar);
changed = true;
@ -628,7 +628,7 @@ static bool select_grouped_object_hooks(bContext *C, Object *ob)
hmd = (HookModifierData *) md;
if (hmd->object && !(hmd->object->flag & SELECT)) {
base = BKE_scene_layer_base_find(sl, hmd->object);
if (base && (BASE_SELECTABLE_NEW(base))) {
if (base && (BASE_SELECTABLE(base))) {
ED_object_base_select(base, BA_SELECT);
changed = true;
}
@ -815,7 +815,7 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
}
ob = OBACT_NEW(sl);
ob = OBACT(sl);
if (ob == NULL) {
BKE_report(op->reports, RPT_ERROR, "No active object");
return OPERATOR_CANCELLED;

View File

@ -4458,7 +4458,7 @@ static void get_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo)
void PE_undo_push(Scene *scene, SceneLayer *sl, const char *str)
{
PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl));
PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
PTCacheUndo *undo;
int nr;
@ -4500,7 +4500,7 @@ void PE_undo_push(Scene *scene, SceneLayer *sl, const char *str)
void PE_undo_step(Scene *scene, SceneLayer *sl, int step)
{
PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl));
PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
if (!edit) return;
@ -4531,12 +4531,12 @@ void PE_undo_step(Scene *scene, SceneLayer *sl, int step)
}
}
DEG_id_tag_update(&OBACT_NEW(sl)->id, OB_RECALC_DATA);
DEG_id_tag_update(&OBACT(sl)->id, OB_RECALC_DATA);
}
bool PE_undo_is_valid(Scene *scene, SceneLayer *sl)
{
PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl));
PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
if (edit) {
return (edit->undo.last != edit->undo.first);
@ -4571,7 +4571,7 @@ void PE_redo(Scene *scene, SceneLayer *sl)
void PE_undo_number(Scene *scene, SceneLayer *sl, int nr)
{
PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl));
PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
PTCacheUndo *undo;
int a=0;
@ -4587,7 +4587,7 @@ void PE_undo_number(Scene *scene, SceneLayer *sl, int nr)
/* if active pointer, set it to 1 if true */
const char *PE_undo_get_name(Scene *scene, SceneLayer *sl, int nr, bool *r_active)
{
PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl));
PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
PTCacheUndo *undo;
if (r_active) *r_active = false;
@ -4608,7 +4608,7 @@ const char *PE_undo_get_name(Scene *scene, SceneLayer *sl, int nr, bool *r_activ
int PE_minmax(Scene *scene, SceneLayer *sl, float min[3], float max[3])
{
Object *ob= OBACT_NEW(sl);
Object *ob= OBACT(sl);
PTCacheEdit *edit= PE_get_current(scene, sl, ob);
ParticleSystem *psys;
ParticleSystemModifierData *psmd = NULL;

View File

@ -350,7 +350,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid
channels->DomainTime = MEM_callocN(length * (CHANNEL_FLOAT+1) * sizeof(float), "channel DomainTime");
/* allocate fluid objects */
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
for (base = FIRSTBASE(sl); base; base = base->next) {
Object *ob = base->object;
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
@ -587,7 +587,7 @@ static int fluid_validate_scene(ReportList *reports, SceneLayer *sl, Object *fsD
int channelObjCount = 0;
int fluidInputCount = 0;
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
for (base = FIRSTBASE(sl); base; base = base->next) {
Object *ob = base->object;
FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);

View File

@ -121,7 +121,7 @@ static int rigidbody_con_add_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
SceneLayer *sl = CTX_data_scene_layer(C);
RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene);
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
int type = RNA_enum_get(op->ptr, "type");
bool changed;
@ -170,7 +170,7 @@ static int rigidbody_con_remove_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
SceneLayer *sl = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
/* apply to active object */
if (ELEM(NULL, ob, ob->rigidbody_constraint)) {

View File

@ -766,7 +766,7 @@ static PaintOperation *texture_paint_init(bContext *C, wmOperator *op, const flo
/* initialize from context */
if (CTX_wm_region_view3d(C)) {
SceneLayer *sl = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
bool uvs, mat, tex, stencil;
if (!BKE_paint_proj_mesh_data_check(scene, ob, &uvs, &mat, &tex, &stencil)) {
BKE_paint_data_warning(op->reports, uvs, mat, tex, stencil);

View File

@ -5326,7 +5326,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
int orig_brush_size;
IDProperty *idgroup;
IDProperty *view_data = NULL;
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
bool uvs, mat, tex;
if (ob == NULL || ob->type != OB_MESH) {

View File

@ -453,7 +453,7 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr
if (CTX_wm_view3d(C) && texpaint_proj) {
/* first try getting a colour directly from the mesh faces if possible */
SceneLayer *sl = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
bool sample_success = false;
ImagePaintSettings *imapaint = &scene->toolsettings->imapaint;
bool use_material = (imapaint->mode == IMAGEPAINT_MODE_MATERIAL);

View File

@ -364,7 +364,7 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
workspace = CTX_wm_workspace(C);
}
SceneLayer *scene_layer = BKE_scene_layer_from_workspace_get(scene, workspace);
ob = OBACT_NEW(scene_layer);
ob = OBACT(scene_layer);
}
if (ob && ob->type == OB_LAMP && !la)

View File

@ -99,7 +99,7 @@ static Object *get_orientation_object(bContext *C)
object = get_camera_with_movieclip(scene, clip);
}
else {
object = OBACT_NEW(sl);
object = OBACT(sl);
}
if (object != NULL && object->parent != NULL) {
@ -122,7 +122,7 @@ static int set_orientation_poll(bContext *C)
return true;
}
else {
return OBACT_NEW(sl) != NULL;
return OBACT(sl) != NULL;
}
}
}

View File

@ -377,7 +377,7 @@ bool ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit)
bool ED_space_image_check_show_maskedit(SceneLayer *sl, SpaceImage *sima)
{
/* check editmode - this is reserved for UV editing */
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
if (ob && ob->mode & OB_MODE_EDIT && ED_space_image_show_uvedit(sima, ob)) {
return false;
}

View File

@ -538,7 +538,7 @@ static void image_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn, Sc
case ND_MODIFIER:
{
SceneLayer *sl = BKE_scene_layer_from_workspace_get(scene, workspace);
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
if (ob && (ob == wmn->reference) && (ob->mode & OB_MODE_EDIT)) {
if (sima->lock && (sima->flag & SI_DRAWSHADOW)) {
ED_area_tag_refresh(sa);

View File

@ -485,7 +485,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
ob= ob->id.next;
}
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
for (base = FIRSTBASE(sl); base; base = base->next) {
if ((base->flag & BASE_VISIBLED) && (base->flag & SELECT)) {
if (scavisflag & BUTS_SENS_SEL) base->object->scavisflag |= OB_VIS_SENS;
if (scavisflag & BUTS_CONT_SEL) base->object->scavisflag |= OB_VIS_CONT;

View File

@ -362,7 +362,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
BLI_strncpy(newname, ebone->name, sizeof(ebone->name));
BLI_strncpy(ebone->name, oldname, sizeof(ebone->name));
ED_armature_bone_rename(obedit->data, oldname, newname);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, OBACT_NEW(sl));
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, OBACT(sl));
}
break;
}
@ -375,7 +375,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
/* always make current object active */
tree_element_active(C, scene, sl, soops, te, OL_SETSEL_NORMAL, true);
ob = OBACT_NEW(sl);
ob = OBACT(sl);
/* restore bone name */
BLI_strncpy(newname, bone->name, sizeof(bone->name));
@ -392,7 +392,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
/* always make current pose-bone active */
tree_element_active(C, scene, sl, soops, te, OL_SETSEL_NORMAL, true);
ob = OBACT_NEW(sl);
ob = OBACT(sl);
BLI_assert(ob->type == OB_ARMATURE);
@ -1257,7 +1257,7 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Sce
/* active blocks get white circle */
if (tselem->type == 0) {
if (te->idcode == ID_OB) {
active = (OBACT_NEW(sl) == (Object *)tselem->id) ? OL_DRAWSEL_NORMAL : OL_DRAWSEL_NONE;
active = (OBACT(sl) == (Object *)tselem->id) ? OL_DRAWSEL_NORMAL : OL_DRAWSEL_NONE;
}
else if (scene->obedit && scene->obedit->data == tselem->id) {
active = OL_DRAWSEL_NORMAL;
@ -1363,13 +1363,13 @@ static void outliner_draw_tree_element(
else if (te->idcode == ID_OB) {
Object *ob = (Object *)tselem->id;
if (ob == OBACT_NEW(sl) || (ob->flag & SELECT)) {
if (ob == OBACT(sl) || (ob->flag & SELECT)) {
char col[4] = {0, 0, 0, 0};
/* outliner active ob: always white text, circle color now similar to view3d */
active = OL_DRAWSEL_ACTIVE;
if (ob == OBACT_NEW(sl)) {
if (ob == OBACT(sl)) {
if (ob->flag & SELECT) {
UI_GetThemeColorType4ubv(TH_ACTIVE, SPACE_VIEW3D, col);
col[3] = alpha;

View File

@ -985,7 +985,7 @@ static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op))
TreeElement *te;
int xdelta, ytop;
Object *obact = OBACT_NEW(sl);
Object *obact = OBACT(sl);
if (!obact)
return OPERATOR_CANCELLED;

View File

@ -103,7 +103,7 @@ static void do_outliner_object_select_recursive(SceneLayer *sl, Object *ob_paren
{
Base *base;
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
for (base = FIRSTBASE(sl); base; base = base->next) {
Object *ob = base->object;
if ((((base->flag & BASE_VISIBLED) == 0) && BKE_object_is_child_recursive(ob_parent, ob))) {
ED_object_base_select(base, select ? BA_SELECT : BA_DESELECT);
@ -151,7 +151,7 @@ static eOLDrawState tree_element_set_active_object(
}
else {
ob = (Object *)outliner_search_back(soops, te, ID_OB);
if (ob == OBACT_NEW(sl)) {
if (ob == OBACT(sl)) {
return OL_DRAWSEL_NONE;
}
}
@ -209,7 +209,7 @@ static eOLDrawState tree_element_active_material(
/* we search for the object parent */
ob = (Object *)outliner_search_back(soops, te, ID_OB);
// note: ob->matbits can be NULL when a local object points to a library mesh.
if (ob == NULL || ob != OBACT_NEW(sl) || ob->matbits == NULL) {
if (ob == NULL || ob != OBACT(sl) || ob->matbits == NULL) {
return OL_DRAWSEL_NONE; /* just paranoia */
}
@ -258,7 +258,7 @@ static eOLDrawState tree_element_active_texture(
{
TreeElement *tep;
TreeStoreElem /* *tselem,*/ *tselemp;
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
SpaceButs *sbuts = NULL;
if (ob == NULL) {
@ -347,7 +347,7 @@ static eOLDrawState tree_element_active_lamp(
/* we search for the object parent */
ob = (Object *)outliner_search_back(soops, te, ID_OB);
if (ob == NULL || ob != OBACT_NEW(sl)) {
if (ob == NULL || ob != OBACT(sl)) {
/* just paranoia */
return OL_DRAWSEL_NONE;
}
@ -423,7 +423,7 @@ static eOLDrawState tree_element_active_defgroup(
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, ob);
}
else {
if (ob == OBACT_NEW(sl))
if (ob == OBACT(sl))
if (ob->actdef == te->index + 1) {
return OL_DRAWSEL_NORMAL;
}
@ -443,7 +443,7 @@ static eOLDrawState tree_element_active_posegroup(
}
}
else {
if (ob == OBACT_NEW(sl) && ob->pose) {
if (ob == OBACT(sl) && ob->pose) {
if (ob->pose->active_group == te->index + 1) {
return OL_DRAWSEL_NORMAL;
}
@ -487,7 +487,7 @@ static eOLDrawState tree_element_active_posechannel(
}
}
else {
if (ob == OBACT_NEW(sl) && ob->pose) {
if (ob == OBACT(sl) && ob->pose) {
if (pchan->bone->flag & BONE_SELECTED) {
return OL_DRAWSEL_NORMAL;
}
@ -504,7 +504,7 @@ static eOLDrawState tree_element_active_bone(
if (set != OL_SETSEL_NONE) {
if (!(bone->flag & BONE_HIDDEN_P)) {
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
if (ob) {
if (set != OL_SETSEL_EXTEND) {
/* single select forces all other bones to get unselected */
@ -533,7 +533,7 @@ static eOLDrawState tree_element_active_bone(
}
}
else {
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
if (ob && ob->data == arm) {
if (bone->flag & BONE_SELECTED) {
@ -842,7 +842,7 @@ eOLDrawState tree_element_type_active(
if (set != OL_SETSEL_NONE) {
tree_element_set_active_object(C, scene, sl, soops, te, set, false);
}
else if (tselem->id == (ID *)OBACT_NEW(sl)) {
else if (tselem->id == (ID *)OBACT(sl)) {
return OL_DRAWSEL_NORMAL;
}
break;

View File

@ -1873,7 +1873,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SceneLayer *sl, SpaceOops
}
}
else if (soops->outlinevis == SO_SAME_TYPE) {
Object *ob_active = OBACT_NEW(sl);
Object *ob_active = OBACT(sl);
if (ob_active) {
FOREACH_SCENE_OBJECT(scene, ob)
{
@ -1952,8 +1952,8 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SceneLayer *sl, SpaceOops
outliner_add_collections_master(soops, scene);
}
else {
ten = outliner_add_element(soops, &soops->tree, OBACT_NEW(sl), NULL, 0, 0);
ten->directdata = BASACT_NEW(sl);
ten = outliner_add_element(soops, &soops->tree, OBACT(sl), NULL, 0, 0);
ten->directdata = BASACT(sl);
}
if ((soops->flag & SO_SKIP_SORT_ALPHA) == 0) {

View File

@ -2986,10 +2986,10 @@ bool draw_armature(
draw_ghost_poses(eval_ctx, scene, sl, v3d, ar, base);
}
if ((dflag & DRAW_SCENESET) == 0) {
if (ob == OBACT_NEW(sl))
if (ob == OBACT(sl))
arm->flag |= ARM_POSEMODE;
else if (OBACT_NEW(sl) && (OBACT_NEW(sl)->mode & OB_MODE_WEIGHT_PAINT)) {
if (ob == modifiers_isDeformedByArmature(OBACT_NEW(sl)))
else if (OBACT(sl) && (OBACT(sl)->mode & OB_MODE_WEIGHT_PAINT)) {
if (ob == modifiers_isDeformedByArmature(OBACT(sl)))
arm->flag |= ARM_POSEMODE;
}
draw_pose_paths(scene, v3d, ar, ob);

View File

@ -320,7 +320,7 @@ bool draw_glsl_material(Scene *scene, SceneLayer *sl, Object *ob, View3D *v3d, c
return false;
if (!check_object_draw_texture(scene, v3d, dt))
return false;
if (ob == OBACT_NEW(sl) && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
if (ob == OBACT(sl) && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
return false;
if (v3d->flag2 & V3D_SHOW_SOLID_MATCAP)
@ -4312,7 +4312,7 @@ static void draw_mesh_fancy(
eWireDrawMode draw_wire = OBDRAW_WIRE_OFF;
bool /* no_verts,*/ no_edges, no_faces;
DerivedMesh *dm = mesh_get_derived_final(eval_ctx, scene, ob, scene->customdata_mask);
const bool is_obact = (ob == OBACT_NEW(sl));
const bool is_obact = (ob == OBACT(sl));
int draw_flags = (is_obact && BKE_paint_select_face_test(ob)) ? DRAW_FACE_SELECT : 0;
if (!dm)
@ -4728,7 +4728,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
eWireDrawMode draw_wire = OBDRAW_WIRE_OFF; /* could be bool draw_wire_overlay */
bool no_edges, no_faces;
DerivedMesh *dm = mesh_get_derived_final(eval_ctx, scene, ob, scene->customdata_mask);
const bool is_obact = (ob == OBACT_NEW(sl));
const bool is_obact = (ob == OBACT(sl));
int draw_flags = (is_obact && BKE_paint_select_face_test(ob)) ? DRAW_FACE_SELECT : 0;
if (!dm)
@ -4849,7 +4849,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
!(G.f & G_PICKSEL || (draw_flags & DRAW_FACE_SELECT)) &&
(draw_wire == OBDRAW_WIRE_OFF))
{
draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW(sl)));
draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT(sl)));
}
if (draw_glsl_material(scene, sl, ob, v3d, dt) && !(draw_flags & DRAW_MODIFIERS_PREVIEW)) {
@ -4916,7 +4916,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
(draw_wire == OBDRAW_WIRE_OFF) &&
(ob->sculpt == NULL))
{
draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW(sl)));
draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT(sl)));
}
/* materials arent compatible with vertex colors */
@ -4941,7 +4941,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
(ob->sculpt == NULL))
{
/* TODO: move this into a separate pass */
draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW(sl)));
draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT(sl)));
}
glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
@ -8578,7 +8578,7 @@ void draw_object(
unsigned char _ob_wire_col[4]; /* dont initialize this */
const unsigned char *ob_wire_col = NULL; /* dont initialize this, use NULL crashes as a way to find invalid use */
bool zbufoff = false, is_paint = false, empty_object = false;
const bool is_obact = (ob == OBACT_NEW(sl));
const bool is_obact = (ob == OBACT(sl));
const bool render_override = (v3d->flag2 & V3D_RENDER_OVERRIDE) != 0;
const bool is_picking = (G.f & G_PICKSEL) != 0;
const bool has_particles = (ob->particlesystem.first != NULL);

View File

@ -788,7 +788,7 @@ static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
static int view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt))
{
SceneLayer *sl = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
if (ob && (BKE_object_is_in_editmode_vgroup(ob) ||
BKE_object_is_in_wpaint_select_vert(ob)))
{
@ -1099,7 +1099,7 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event
{
SceneLayer *sl = CTX_data_scene_layer(C);
View3D *v3d = CTX_wm_view3d(C);
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
switch (event) {

View File

@ -1316,7 +1316,7 @@ float ED_view3d_grid_scale(Scene *scene, View3D *v3d, const char **grid_unit)
static bool is_cursor_visible(Scene *scene, SceneLayer *sl)
{
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
/* don't draw cursor in paint modes, but with a few exceptions */
if (ob && ob->mode & OB_MODE_ALL_PAINT) {
@ -1847,7 +1847,7 @@ void view3d_draw_region_info(const bContext *C, ARegion *ar, const int offset)
if (U.uiflag & USER_DRAWVIEWINFO) {
SceneLayer *sl = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
draw_selected_name(scene, ob, &rect);
}
#if 0 /* TODO */

View File

@ -1285,12 +1285,12 @@ void ED_view3d_draw_select_loop(
UI_SetTheme(SPACE_VIEW3D, RGN_TYPE_WINDOW);
if (vc->obedit && vc->obedit->type == OB_MBALL) {
draw_object(eval_ctx, scene, sl, ar, v3d, BASACT_NEW(sl), dflag);
draw_object(eval_ctx, scene, sl, ar, v3d, BASACT(sl), dflag);
}
else if ((vc->obedit && vc->obedit->type == OB_ARMATURE)) {
/* if not drawing sketch, draw bones */
if (!BDR_drawSketchNames(vc)) {
draw_object(eval_ctx, scene, sl, ar, v3d, BASACT_NEW(sl), dflag);
draw_object(eval_ctx, scene, sl, ar, v3d, BASACT(sl), dflag);
}
}
else {
@ -2070,7 +2070,7 @@ static void view3d_main_region_draw_info(const bContext *C, Scene *scene,
draw_view_icon(rv3d, &rect);
if (U.uiflag & USER_DRAWVIEWINFO) {
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
VP_legacy_draw_selected_name(scene, ob, &rect);
}
}

View File

@ -625,7 +625,7 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
Scene *scene = CTX_data_scene(C);
SceneLayer *sl = CTX_data_scene_layer(C);
Object *ob_act = OBACT_NEW(sl);
Object *ob_act = OBACT(sl);
if (ob_act && (ob_act->mode & OB_MODE_ALL_PAINT) &&
/* with weight-paint + pose-mode, fall through to using calculateTransformCenter */
@ -667,8 +667,8 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
float select_center[3];
zero_v3(select_center);
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
if (TESTBASE_NEW(base)) {
for (base = FIRSTBASE(sl); base; base = base->next) {
if (TESTBASE(base)) {
/* use the boundbox if we can */
Object *ob = base->object;
@ -3015,7 +3015,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in
}
for (base = sl->object_bases.first; base; base = base->next) {
if (BASE_VISIBLE_NEW(base)) {
if (BASE_VISIBLE(base)) {
changed = true;
if (skip_camera && base->object == v3d->camera) {
@ -3080,7 +3080,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
const bool is_gp_edit = ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE));
const bool is_face_map = ((is_gp_edit == false) && ar->manipulator_map &&
WM_manipulatormap_is_any_selected(ar->manipulator_map));
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
Object *obedit = CTX_data_edit_object(C);
float min[3], max[3];
bool ok = false, ok_dist = true;
@ -3100,7 +3100,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
/* this is weak code this way, we should make a generic active/selection callback interface once... */
Base *base;
for (base = sl->object_bases.first; base; base = base->next) {
if (TESTBASELIB_NEW(base)) {
if (TESTBASELIB(base)) {
if (base->object->type == OB_ARMATURE)
if (base->object->mode & OB_MODE_POSE)
break;
@ -3148,8 +3148,8 @@ static int viewselected_exec(bContext *C, wmOperator *op)
}
else {
Base *base;
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
if (TESTBASE_NEW(base)) {
for (base = FIRSTBASE(sl); base; base = base->next) {
if (TESTBASE(base)) {
if (skip_camera && base->object == v3d->camera) {
continue;
@ -3950,7 +3950,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
/* lastview - */
if (rv3d->persp != RV3D_CAMOB) {
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
if (!rv3d->smooth_timer) {
/* store settings of current view before allowing overwriting with camera view

View File

@ -283,7 +283,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
SceneLayer *sl = CTX_data_scene_layer(C);
ToolSettings *ts = CTX_data_tool_settings(C);
PointerRNA v3dptr, toolsptr, sceneptr;
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
Object *obedit = CTX_data_edit_object(C);
bGPdata *gpd = CTX_data_gpencil_data(C);
uiBlock *block;

View File

@ -295,7 +295,7 @@ static bool WIDGETGROUP_camera_view_poll(const bContext *C, wmManipulatorGroupTy
* We could change the rules for when to show. */
{
SceneLayer *sl = CTX_data_scene_layer(C);
if (scene->camera != OBACT_NEW(sl)) {
if (scene->camera != OBACT(sl)) {
return false;
}
}

View File

@ -382,7 +382,7 @@ static void object_deselect_all_visible(SceneLayer *sl)
Base *base;
for (base = sl->object_bases.first; base; base = base->next) {
if (BASE_SELECTABLE_NEW(base)) {
if (BASE_SELECTABLE(base)) {
ED_object_base_select(base, BA_DESELECT);
}
}
@ -397,7 +397,7 @@ static void do_lasso_select_objects(ViewContext *vc, const int mcords[][2], cons
object_deselect_all_visible(vc->scene_layer);
for (base = vc->scene_layer->object_bases.first; base; base = base->next) {
if (BASE_SELECTABLE_NEW(base)) { /* use this to avoid un-needed lasso lookups */
if (BASE_SELECTABLE(base)) { /* use this to avoid un-needed lasso lookups */
if (ED_view3d_project_base(vc->ar, base) == V3D_PROJ_RET_OK) {
if (BLI_lasso_is_point_inside(mcords, moves, base->sx, base->sy, IS_CLIPPED)) {
@ -1295,8 +1295,8 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
}
else {
/* only exclude active object when it is selected... */
if (BASACT_NEW(sl) && (BASACT_NEW(sl)->flag & BASE_SELECTED) && hits > 1) {
notcol = BASACT_NEW(sl)->object->select_color;
if (BASACT(sl) && (BASACT(sl)->flag & BASE_SELECTED) && hits > 1) {
notcol = BASACT(sl)->object->select_color;
}
for (a = 0; a < hits; a++) {
@ -1307,9 +1307,9 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
}
}
base = FIRSTBASE_NEW(sl);
base = FIRSTBASE(sl);
while (base) {
if (BASE_SELECTABLE_NEW(base)) {
if (BASE_SELECTABLE(base)) {
if (base->object->select_color == selcol) break;
}
base = base->next;
@ -1324,11 +1324,11 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
* with an un-selectable choice */
if ((base->flag & BASE_SELECTABLED) == 0) {
base = base->next;
if (base == NULL) base = FIRSTBASE_NEW(sl);
if (base == NULL) base = FIRSTBASE(sl);
if (base == startbase) break;
}
if (BASE_SELECTABLE_NEW(base)) {
if (BASE_SELECTABLE(base)) {
for (a = 0; a < hits; a++) {
if (has_bones) {
/* skip non-bone objects */
@ -1347,7 +1347,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
if (basact) break;
base = base->next;
if (base == NULL) base = FIRSTBASE_NEW(sl);
if (base == NULL) base = FIRSTBASE(sl);
if (base == startbase) break;
}
}
@ -1429,8 +1429,8 @@ static bool ed_object_select_pick(
}
/* always start list from basact in wire mode */
startbase = FIRSTBASE_NEW(sl);
if (BASACT_NEW(sl) && BASACT_NEW(sl)->next) startbase = BASACT_NEW(sl)->next;
startbase = FIRSTBASE(sl);
if (BASACT(sl) && BASACT(sl)->next) startbase = BASACT(sl)->next;
/* This block uses the control key to make the object selected by its center point rather than its contents */
/* in editmode do not activate */
@ -1443,13 +1443,13 @@ static bool ed_object_select_pick(
else {
base = startbase;
while (base) {
if (BASE_SELECTABLE_NEW(base)) {
if (BASE_SELECTABLE(base)) {
float screen_co[2];
if (ED_view3d_project_float_global(ar, base->object->obmat[3], screen_co,
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
{
float dist_temp = len_manhattan_v2v2(mval_fl, screen_co);
if (base == BASACT_NEW(sl)) dist_temp += 10.0f;
if (base == BASACT(sl)) dist_temp += 10.0f;
if (dist_temp < dist) {
dist = dist_temp;
basact = base;
@ -1458,7 +1458,7 @@ static bool ed_object_select_pick(
}
base = base->next;
if (base == NULL) base = FIRSTBASE_NEW(sl);
if (base == NULL) base = FIRSTBASE(sl);
if (base == startbase) break;
}
}
@ -1488,7 +1488,7 @@ static bool ed_object_select_pick(
if (has_bones && basact) {
if (basact->object->type == OB_CAMERA) {
if (BASACT_NEW(sl) == basact) {
if (BASACT(sl) == basact) {
int i, hitresult;
bool changed = false;
@ -1558,14 +1558,14 @@ static bool ed_object_select_pick(
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_ACTIVE, basact->object);
/* in weightpaint, we use selected bone to select vertexgroup, so no switch to new active object */
if (BASACT_NEW(sl) && (BASACT_NEW(sl)->object->mode & OB_MODE_WEIGHT_PAINT)) {
if (BASACT(sl) && (BASACT(sl)->object->mode & OB_MODE_WEIGHT_PAINT)) {
/* prevent activating */
basact = NULL;
}
}
/* prevent bone selecting to pass on to object selecting */
if (basact == BASACT_NEW(sl))
if (basact == BASACT(sl))
basact = NULL;
}
}
@ -1581,9 +1581,9 @@ static bool ed_object_select_pick(
ED_object_base_select(basact, BA_SELECT);
}
/* also prevent making it active on mouse selection */
else if (BASE_SELECTABLE_NEW(basact)) {
else if (BASE_SELECTABLE(basact)) {
oldbasact = BASACT_NEW(sl);
oldbasact = BASACT(sl);
if (extend) {
ED_object_base_select(basact, BA_SELECT);
@ -2095,7 +2095,7 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, b
* we can be sure the order remains the same between both.
*/
for (base = vc->scene_layer->object_bases.first; base && hits; base = base->next) {
if (BASE_SELECTABLE_NEW(base)) {
if (BASE_SELECTABLE(base)) {
while (base->object->select_color == (*col & 0xFFFF)) { /* we got an object */
if (*col & 0xFFFF0000) { /* we got a bone */
bone = get_indexed_bone(base->object, *col & ~(BONESEL_ANY));
@ -2837,8 +2837,8 @@ static bool object_circle_select(ViewContext *vc, const bool select, const int m
Base *base;
for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
if (BASE_SELECTABLE_NEW(base) && ((base->flag & BASE_SELECTED) != select_flag)) {
for (base = FIRSTBASE(sl); base; base = base->next) {
if (BASE_SELECTABLE(base) && ((base->flag & BASE_SELECTED) != select_flag)) {
float screen_co[2];
if (ED_view3d_project_float_global(vc->ar, base->object->obmat[3], screen_co,
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)

View File

@ -1906,7 +1906,7 @@ static void drawTransformPixel(const struct bContext *UNUSED(C), ARegion *ar, vo
TransInfo *t = arg;
Scene *scene = t->scene;
SceneLayer *sl = t->scene_layer;
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
/* draw autokeyframing hint in the corner
* - only draw if enabled (advanced users may be distracted/annoyed),

View File

@ -292,7 +292,7 @@ static void createTransTexspace(TransInfo *t)
ID *id;
short *texflag;
ob = OBACT_NEW(sl);
ob = OBACT(sl);
if (ob == NULL) { // Shouldn't logically happen, but still...
t->total = 0;
@ -2011,7 +2011,7 @@ void flushTransParticles(TransInfo *t)
{
Scene *scene = t->scene;
SceneLayer *sl = t->scene_layer;
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
PTCacheEdit *edit = PE_get_current(scene, sl, ob);
ParticleSystem *psys = edit->psys;
ParticleSystemModifierData *psmd = NULL;
@ -2053,7 +2053,7 @@ void flushTransParticles(TransInfo *t)
EvaluationContext eval_ctx;
CTX_data_eval_ctx(t->context, &eval_ctx);
PE_update_object(&eval_ctx, scene, sl, OBACT_NEW(sl), 1);
PE_update_object(&eval_ctx, scene, sl, OBACT(sl), 1);
}
/* ********************* mesh ****************** */
@ -5576,7 +5576,7 @@ static void set_trans_object_base_flags(TransInfo *t)
for (base = sl->object_bases.first; base; base = base->next) {
base->flag_legacy &= ~BA_WAS_SEL;
if (TESTBASELIB_BGMODE_NEW(base)) {
if (TESTBASELIB_BGMODE(base)) {
Object *ob = base->object;
Object *parsel = ob->parent;
@ -5585,7 +5585,7 @@ static void set_trans_object_base_flags(TransInfo *t)
if (parsel->base_flag & BASE_SELECTED) {
Base *parbase = BKE_scene_layer_base_find(sl, parsel);
if (parbase) { /* in rare cases this can fail */
if (TESTBASELIB_BGMODE_NEW(parbase)) {
if (TESTBASELIB_BGMODE(parbase)) {
break;
}
}
@ -5656,7 +5656,7 @@ static int count_proportional_objects(TransInfo *t)
{
/* mark all parents */
for (base = sl->object_bases.first; base; base = base->next) {
if (TESTBASELIB_BGMODE_NEW(base)) {
if (TESTBASELIB_BGMODE(base)) {
Object *parent = base->object->parent;
/* flag all parents */
@ -5672,7 +5672,7 @@ static int count_proportional_objects(TransInfo *t)
/* all base not already selected or marked that is editable */
if ((base->object->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
(base->flag & BASE_SELECTED) == 0 &&
(BASE_EDITABLE_BGMODE_NEW(base)))
(BASE_EDITABLE_BGMODE(base)))
{
mark_children(base->object);
}
@ -5685,7 +5685,7 @@ static int count_proportional_objects(TransInfo *t)
/* if base is not selected, not a parent of selection or not a child of selection and it is editable */
if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
(base->flag & BASE_SELECTED) == 0 &&
(BASE_EDITABLE_BGMODE_NEW(base)))
(BASE_EDITABLE_BGMODE(base)))
{
DEG_id_tag_update(&ob->id, OB_RECALC_OB);
@ -5778,7 +5778,7 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, SceneLayer *sl, View3D *
}
else if (ELEM(tmode, TFM_ROTATION, TFM_TRACKBALL)) {
if (v3d->around == V3D_AROUND_ACTIVE) {
if (ob != OBACT_NEW(sl))
if (ob != OBACT(sl))
do_loc = true;
}
else if (v3d->around == V3D_AROUND_CURSOR)
@ -5789,7 +5789,7 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, SceneLayer *sl, View3D *
}
else if (tmode == TFM_RESIZE) {
if (v3d->around == V3D_AROUND_ACTIVE) {
if (ob != OBACT_NEW(sl))
if (ob != OBACT(sl))
do_loc = true;
}
else if (v3d->around == V3D_AROUND_CURSOR)
@ -6643,7 +6643,7 @@ static void createTransObject(bContext *C, TransInfo *t)
/* if base is not selected, not a parent of selection or not a child of selection and it is editable */
if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
(base->flag & BASE_SELECTED) == 0 &&
BASE_EDITABLE_BGMODE_NEW(base))
BASE_EDITABLE_BGMODE(base))
{
td->protectflag = ob->protectflag;
td->ext = tx;
@ -8091,7 +8091,7 @@ void createTransData(bContext *C, TransInfo *t)
{
Scene *scene = t->scene;
SceneLayer *sl = t->scene_layer;
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
/* if tests must match recalcData for correct updates */
if (t->options & CTX_TEXTURE) {
@ -8258,7 +8258,7 @@ void createTransData(bContext *C, TransInfo *t)
if (ob_armature && ob_armature->mode & OB_MODE_POSE) {
Base *base_arm = BKE_scene_layer_base_find(t->scene_layer, ob_armature);
if (base_arm) {
if (BASE_VISIBLE_NEW(base_arm)) {
if (BASE_VISIBLE(base_arm)) {
createTransPose(t, ob_armature);
}
}

View File

@ -331,7 +331,7 @@ static void recalcData_actedit(TransInfo *t)
/* NOTE: sync this with the code in ANIM_animdata_get_context() */
ac.scene = t->scene;
ac.scene_layer = t->scene_layer;
ac.obact = OBACT_NEW(sl);
ac.obact = OBACT(sl);
ac.sa = t->sa;
ac.ar = t->ar;
ac.sl = (t->sa) ? t->sa->spacedata.first : NULL;
@ -381,7 +381,7 @@ static void recalcData_graphedit(TransInfo *t)
/* NOTE: sync this with the code in ANIM_animdata_get_context() */
ac.scene = t->scene;
ac.scene_layer = t->scene_layer;
ac.obact = OBACT_NEW(sl);
ac.obact = OBACT(sl);
ac.sa = t->sa;
ac.ar = t->ar;
ac.sl = (t->sa) ? t->sa->spacedata.first : NULL;
@ -1804,7 +1804,7 @@ bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[3])
}
else if (t->flag & T_POSE) {
SceneLayer *sl = t->scene_layer;
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
if (ob) {
bPoseChannel *pchan = BKE_pose_channel_active(ob);
if (pchan && (!select_only || (pchan->bone->flag & BONE_SELECTED))) {
@ -1824,8 +1824,8 @@ bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[3])
else {
/* object mode */
SceneLayer *sl = t->scene_layer;
Object *ob = OBACT_NEW(sl);
Base *base = BASACT_NEW(sl);
Object *ob = OBACT(sl);
Base *base = BASACT(sl);
if (ob && ((!select_only) || ((base->flag & BASE_SELECTED) != 0))) {
copy_v3_v3(r_center, ob->obmat[3]);
ok = true;

View File

@ -596,7 +596,7 @@ static int calc_manipulator_stats(
View3D *v3d = sa->spacedata.first;
RegionView3D *rv3d = ar->regiondata;
Base *base;
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
bGPdata *gpd = CTX_data_gpencil_data(C);
const bool is_gp_edit = ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE));
int a, totsel = 0;
@ -998,12 +998,12 @@ static int calc_manipulator_stats(
else {
/* we need the one selected object, if its not active */
base = BASACT_NEW(sl);
ob = OBACT_NEW(sl);
base = BASACT(sl);
ob = OBACT(sl);
if (base && ((base->flag & BASE_SELECTED) == 0)) ob = NULL;
for (base = sl->object_bases.first; base; base = base->next) {
if (TESTBASELIB_NEW(base)) {
if (TESTBASELIB(base)) {
if (ob == NULL)
ob = base->object;
if (use_only_center || base->object->bb == NULL) {
@ -1062,7 +1062,7 @@ static void manipulator_prepare_mat(
case V3D_AROUND_ACTIVE:
{
bGPdata *gpd = CTX_data_gpencil_data(C);
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
if (((v3d->around == V3D_AROUND_ACTIVE) && (scene->obedit == NULL)) &&
((gpd == NULL) || !(gpd->flag & GP_DATA_STROKE_EDITMODE)) &&
@ -1591,7 +1591,7 @@ static void WIDGETGROUP_xform_cage_draw_prepare(const bContext *C, wmManipulator
wmManipulator *mpr = xmgroup->manipulator;
SceneLayer *sl = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
if (ob && ob->mode & OB_MODE_EDIT) {
copy_m4_m4(mpr->matrix_space, ob->obmat);
}

View File

@ -581,7 +581,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
SceneLayer *sl = CTX_data_scene_layer(C);
Object *obedit = CTX_data_edit_object(C);
Base *base;
Object *ob = OBACT_NEW(sl);
Object *ob = OBACT(sl);
int result = ORIENTATION_NONE;
const bool activeOnly = (around == V3D_AROUND_ACTIVE);
@ -1044,8 +1044,8 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
}
else {
/* we need the one selected object, if its not active */
base = BASACT_NEW(sl);
ob = OBACT_NEW(sl);
base = BASACT(sl);
ob = OBACT(sl);
if (base && ((base->flag & BASE_SELECTED) != 0)) {
/* pass */
}
@ -1053,7 +1053,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
/* first selected */
ob = NULL;
for (base = sl->object_bases.first; base; base = base->next) {
if (TESTBASELIB_NEW(base)) {
if (TESTBASELIB(base)) {
ob = base->object;
break;
}

View File

@ -78,7 +78,7 @@
#include "transform.h"
/* this should be passed as an arg for use in snap functions */
#undef BASACT_NEW
#undef BASACT
/* use half of flt-max so we can scale up without an exception */

View File

@ -171,7 +171,7 @@ static void iter_snap_objects(
}
for (Base *base = sctx->eval_ctx.scene_layer->object_bases.first; base != NULL; base = base->next) {
if ((BASE_VISIBLE_NEW(base)) && (base->flag_legacy & (BA_HAS_RECALC_OB | BA_HAS_RECALC_DATA)) == 0 &&
if ((BASE_VISIBLE(base)) && (base->flag_legacy & (BA_HAS_RECALC_OB | BA_HAS_RECALC_DATA)) == 0 &&
!((snap_select == SNAP_NOT_SELECTED && ((base->flag & BASE_SELECTED) || (base->flag_legacy & BA_WAS_SEL))) ||
(snap_select == SNAP_NOT_ACTIVE && base == base_act)))
{

View File

@ -2043,7 +2043,7 @@ int GPU_scene_object_lights(SceneLayer *scene_layer, float viewmat[4][4], int or
int count = 0;
for (Base *base = FIRSTBASE_NEW(scene_layer); base; base = base->next) {
for (Base *base = FIRSTBASE(scene_layer); base; base = base->next) {
if (base->object->type != OB_LAMP)
continue;

View File

@ -1912,29 +1912,29 @@ extern const char *RE_engine_id_CYCLES;
#define MINAFRAMEF -1048574.0f
/* deprecate this! */
#define TESTBASE_NEW(base) ( \
#define TESTBASE(base) ( \
(((base)->flag & BASE_SELECTED) != 0) && \
(((base)->flag & BASE_VISIBLED) != 0))
#define TESTBASELIB_NEW(base) ( \
#define TESTBASELIB(base) ( \
(((base)->flag & BASE_SELECTED) != 0) && \
((base)->object->id.lib == NULL) && \
(((base)->flag & BASE_VISIBLED) != 0))
#define TESTBASELIB_BGMODE_NEW(base) ( \
#define TESTBASELIB_BGMODE(base) ( \
(((base)->flag & BASE_SELECTED) != 0) && \
((base)->object->id.lib == NULL) && \
(((base)->flag & BASE_VISIBLED) != 0))
#define BASE_EDITABLE_BGMODE_NEW(base) ( \
#define BASE_EDITABLE_BGMODE(base) ( \
((base)->object->id.lib == NULL) && \
(((base)->flag & BASE_VISIBLED) != 0))
#define BASE_SELECTABLE_NEW(base) \
#define BASE_SELECTABLE(base) \
(((base)->flag & BASE_SELECTABLED) != 0)
#define BASE_VISIBLE_NEW(base) ( \
#define BASE_VISIBLE(base) ( \
((base)->flag & BASE_VISIBLED) != 0)
#define FIRSTBASE_NEW(_sl) ((_sl)->object_bases.first)
#define LASTBASE_NEW(_sl) ((_sl)->object_bases.last)
#define BASACT_NEW(_sl) ((_sl)->basact)
#define OBACT_NEW(_sl) (BASACT_NEW(_sl) ? BASACT_NEW(_sl)->object: NULL)
#define FIRSTBASE(_sl) ((_sl)->object_bases.first)
#define LASTBASE(_sl) ((_sl)->object_bases.last)
#define BASACT(_sl) ((_sl)->basact)
#define OBACT(_sl) (BASACT(_sl) ? BASACT(_sl)->object: NULL)
#define V3D_CAMERA_LOCAL(v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : NULL)
#define V3D_CAMERA_SCENE(scene, v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera)

View File

@ -424,7 +424,7 @@ static void rna_LayerCollectionEngineSettings_wire_update(bContext *C, PointerRN
{
Scene *scene = CTX_data_scene(C);
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
if (ob != NULL && ob->type == OB_MESH) {
BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);

View File

@ -1858,7 +1858,7 @@ static char *rna_MeshStatVis_path(PointerRNA *UNUSED(ptr))
static void rna_Scene_update_active_object_data(bContext *C, PointerRNA *UNUSED(ptr))
{
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
if (ob) {
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);

View File

@ -156,7 +156,7 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr))
{
Scene *scene = CTX_data_scene(C);
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
PTCacheEdit *edit = PE_get_current(scene, scene_layer, ob);
if (!edit)
@ -168,7 +168,7 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr))
static void rna_ParticleEdit_update(Main *UNUSED(bmain), Scene *UNUSED(scene), bContext *C, PointerRNA *UNUSED(ptr))
{
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
if (ob) DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
@ -192,7 +192,7 @@ static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerR
PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
{
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
#if 0
Scene *scene = CTX_data_scene(C);
PTCacheEdit *edit = PE_get_current(scene, ob);
@ -266,7 +266,7 @@ static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr))
{
Scene *scene = CTX_data_scene(C);
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
if (ob) {
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
@ -282,7 +282,7 @@ static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr))
static void rna_Sculpt_ShowDiffuseColor_update(bContext *C, Scene *scene, PointerRNA *UNUSED(ptr))
{
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
if (ob && ob->sculpt) {
Sculpt *sd = scene->toolsettings->sculpt;
@ -345,7 +345,7 @@ static void rna_ImaPaint_mode_update(bContext *C, PointerRNA *UNUSED(ptr))
{
Scene *scene = CTX_data_scene(C);\
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
if (ob && ob->type == OB_MESH) {
/* of course we need to invalidate here */
@ -362,7 +362,7 @@ static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA *UNUSED(ptr))
{
Scene *scene = CTX_data_scene(C);
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
if (ob && ob->type == OB_MESH) {
GPU_drawobject_free(ob->derivedFinal);
@ -376,7 +376,7 @@ static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr))
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
bScreen *sc;
Image *ima = scene->toolsettings->imapaint.canvas;

View File

@ -1325,7 +1325,7 @@ static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr)
SpaceAction *saction = (SpaceAction *)(ptr->data);
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Main *bmain = CTX_data_main(C);
Object *obact = OBACT_NEW(scene_layer);
Object *obact = OBACT(scene_layer);
/* we must set this action to be the one used by active object (if not pinned) */
if (obact /* && saction->pin == 0*/) {
@ -1401,7 +1401,7 @@ static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr)
{
SpaceAction *saction = (SpaceAction *)(ptr->data);
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *obact = OBACT_NEW(scene_layer);
Object *obact = OBACT(scene_layer);
/* special exceptions for ShapeKey Editor mode */
if (saction->mode == SACTCONT_SHAPEKEY) {

View File

@ -86,7 +86,7 @@ static void shader_get_from_context(const bContext *C, bNodeTreeType *UNUSED(tre
Scene *scene = CTX_data_scene(C);
WorkSpace *workspace = CTX_wm_workspace(C);
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
ViewRender *view_render = BKE_viewrender_get(scene, workspace);
if ((snode->shaderfrom == SNODE_SHADER_OBJECT) ||

View File

@ -63,7 +63,7 @@ static void texture_get_from_context(const bContext *C, bNodeTreeType *UNUSED(tr
SpaceNode *snode = CTX_wm_space_node(C);
Scene *scene = CTX_data_scene(C);
SceneLayer *scene_layer = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW(scene_layer);
Object *ob = OBACT(scene_layer);
Tex *tx = NULL;
if (snode->texfrom == SNODE_TEX_OBJECT) {