Outliner Restriction: Naming sanitization and icon
No major API change here, only in the outliner restriction column
variables (e.g., show_restrict_column_selectable > show_restrict_column_select).
* Get rid of _INSTANCE (introduced on b1af682001).
* Differentiate (everywhere but the API) between HIDE (temporary) and VIEWPORT (global).
* Use the expected icon for restrict viewport (same as objects and modifiers).
* selectable > select
This commit is contained in:
@@ -307,9 +307,9 @@ class OUTLINER_PT_filter(Panel):
|
|||||||
layout.label(text="Restriction Toggles:")
|
layout.label(text="Restriction Toggles:")
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(space, "show_restrict_column_enable", text="")
|
row.prop(space, "show_restrict_column_enable", text="")
|
||||||
row.prop(space, "show_restrict_column_selectable", text="")
|
row.prop(space, "show_restrict_column_select", text="")
|
||||||
|
row.prop(space, "show_restrict_column_hide", text="")
|
||||||
row.prop(space, "show_restrict_column_viewport", text="")
|
row.prop(space, "show_restrict_column_viewport", text="")
|
||||||
row.prop(space, "show_restrict_column_instance", text="")
|
|
||||||
row.prop(space, "show_restrict_column_render", text="")
|
row.prop(space, "show_restrict_column_render", text="")
|
||||||
row.prop(space, "show_restrict_column_holdout", text="")
|
row.prop(space, "show_restrict_column_holdout", text="")
|
||||||
row.prop(space, "show_restrict_column_indirect_only", text="")
|
row.prop(space, "show_restrict_column_indirect_only", text="")
|
||||||
@@ -317,9 +317,9 @@ class OUTLINER_PT_filter(Panel):
|
|||||||
elif display_mode == 'SCENES':
|
elif display_mode == 'SCENES':
|
||||||
layout.label(text="Restriction Toggles:")
|
layout.label(text="Restriction Toggles:")
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(space, "show_restrict_column_selectable", text="")
|
row.prop(space, "show_restrict_column_select", text="")
|
||||||
|
row.prop(space, "show_restrict_column_hide", text="")
|
||||||
row.prop(space, "show_restrict_column_viewport", text="")
|
row.prop(space, "show_restrict_column_viewport", text="")
|
||||||
row.prop(space, "show_restrict_column_instance", text="")
|
|
||||||
row.prop(space, "show_restrict_column_render", text="")
|
row.prop(space, "show_restrict_column_render", text="")
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void AbcTransformWriter::do_write()
|
|||||||
m_xform, m_xform.getSchema().getTimeSampling());
|
m_xform, m_xform.getSchema().getTimeSampling());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_visibility.set(!(ob_eval->restrictflag & OB_RESTRICT_INSTANCE));
|
m_visibility.set(!(ob_eval->restrictflag & OB_RESTRICT_VIEWPORT));
|
||||||
|
|
||||||
if (!m_first_frame && !m_is_animated) {
|
if (!m_first_frame && !m_is_animated) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -434,8 +434,8 @@ static void collection_object_cache_fill(ListBase *lb, Collection *collection, i
|
|||||||
|
|
||||||
int object_restrict = base->object->restrictflag;
|
int object_restrict = base->object->restrictflag;
|
||||||
|
|
||||||
if (((child_restrict & COLLECTION_RESTRICT_INSTANCE) == 0) &&
|
if (((child_restrict & COLLECTION_RESTRICT_VIEWPORT) == 0) &&
|
||||||
((object_restrict & OB_RESTRICT_INSTANCE) == 0)) {
|
((object_restrict & OB_RESTRICT_VIEWPORT) == 0)) {
|
||||||
base->flag |= BASE_ENABLED_VIEWPORT;
|
base->flag |= BASE_ENABLED_VIEWPORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -693,8 +693,8 @@ static short layer_collection_sync(ViewLayer *view_layer,
|
|||||||
lc->runtime_flag = child_runtime_flag;
|
lc->runtime_flag = child_runtime_flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((child_restrict & COLLECTION_RESTRICT_INSTANCE) == 0) &&
|
if (((child_restrict & COLLECTION_RESTRICT_VIEWPORT) == 0) &&
|
||||||
((child_layer_restrict & LAYER_COLLECTION_RESTRICT_VIEW) == 0)) {
|
((child_layer_restrict & LAYER_COLLECTION_HIDE) == 0)) {
|
||||||
lc->runtime_flag |= LAYER_COLLECTION_VISIBLE;
|
lc->runtime_flag |= LAYER_COLLECTION_VISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -723,9 +723,9 @@ static short layer_collection_sync(ViewLayer *view_layer,
|
|||||||
BLI_addtail(new_object_bases, base);
|
BLI_addtail(new_object_bases, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((child_restrict & COLLECTION_RESTRICT_INSTANCE) == 0) {
|
if ((child_restrict & COLLECTION_RESTRICT_VIEWPORT) == 0) {
|
||||||
base->flag_from_collection |= BASE_ENABLED_VIEWPORT;
|
base->flag_from_collection |= BASE_ENABLED_VIEWPORT;
|
||||||
if ((child_layer_restrict & LAYER_COLLECTION_RESTRICT_VIEW) == 0) {
|
if ((child_layer_restrict & LAYER_COLLECTION_HIDE) == 0) {
|
||||||
base->flag_from_collection |= BASE_VISIBLE;
|
base->flag_from_collection |= BASE_VISIBLE;
|
||||||
if (((child_restrict & COLLECTION_RESTRICT_SELECT) == 0)) {
|
if (((child_restrict & COLLECTION_RESTRICT_SELECT) == 0)) {
|
||||||
base->flag_from_collection |= BASE_SELECTABLE;
|
base->flag_from_collection |= BASE_SELECTABLE;
|
||||||
@@ -1014,8 +1014,8 @@ bool BKE_layer_collection_isolate(Scene *scene,
|
|||||||
bool hide_it = extend && (lc->runtime_flag & LAYER_COLLECTION_VISIBLE);
|
bool hide_it = extend && (lc->runtime_flag & LAYER_COLLECTION_VISIBLE);
|
||||||
|
|
||||||
if ((!ID_IS_LINKED(lc->collection) && !hide_it)) {
|
if ((!ID_IS_LINKED(lc->collection) && !hide_it)) {
|
||||||
if (lc->collection->flag & COLLECTION_RESTRICT_INSTANCE) {
|
if (lc->collection->flag & COLLECTION_RESTRICT_VIEWPORT) {
|
||||||
lc->collection->flag &= ~COLLECTION_RESTRICT_INSTANCE;
|
lc->collection->flag &= ~COLLECTION_RESTRICT_VIEWPORT;
|
||||||
depsgraph_need_update = true;
|
depsgraph_need_update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1024,13 +1024,13 @@ bool BKE_layer_collection_isolate(Scene *scene,
|
|||||||
/* Hide all collections . */
|
/* Hide all collections . */
|
||||||
for (LayerCollection *lc_iter = lc_master->layer_collections.first; lc_iter;
|
for (LayerCollection *lc_iter = lc_master->layer_collections.first; lc_iter;
|
||||||
lc_iter = lc_iter->next) {
|
lc_iter = lc_iter->next) {
|
||||||
layer_collection_flag_set_recursive(lc_iter, LAYER_COLLECTION_RESTRICT_VIEW);
|
layer_collection_flag_set_recursive(lc_iter, LAYER_COLLECTION_HIDE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make all the direct parents visible. */
|
/* Make all the direct parents visible. */
|
||||||
if (hide_it) {
|
if (hide_it) {
|
||||||
lc->flag |= LAYER_COLLECTION_RESTRICT_VIEW;
|
lc->flag |= LAYER_COLLECTION_HIDE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LayerCollection *lc_parent = lc;
|
LayerCollection *lc_parent = lc;
|
||||||
@@ -1044,13 +1044,13 @@ bool BKE_layer_collection_isolate(Scene *scene,
|
|||||||
|
|
||||||
while (lc_parent != lc) {
|
while (lc_parent != lc) {
|
||||||
if (!ID_IS_LINKED(lc_parent->collection)) {
|
if (!ID_IS_LINKED(lc_parent->collection)) {
|
||||||
if (lc_parent->collection->flag & COLLECTION_RESTRICT_INSTANCE) {
|
if (lc_parent->collection->flag & COLLECTION_RESTRICT_VIEWPORT) {
|
||||||
lc_parent->collection->flag &= ~COLLECTION_RESTRICT_INSTANCE;
|
lc_parent->collection->flag &= ~COLLECTION_RESTRICT_VIEWPORT;
|
||||||
depsgraph_need_update = true;
|
depsgraph_need_update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lc_parent->flag &= ~LAYER_COLLECTION_RESTRICT_VIEW;
|
lc_parent->flag &= ~LAYER_COLLECTION_HIDE;
|
||||||
|
|
||||||
for (LayerCollection *lc_iter = lc_parent->layer_collections.first; lc_iter;
|
for (LayerCollection *lc_iter = lc_parent->layer_collections.first; lc_iter;
|
||||||
lc_iter = lc_iter->next) {
|
lc_iter = lc_iter->next) {
|
||||||
@@ -1062,7 +1062,7 @@ bool BKE_layer_collection_isolate(Scene *scene,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make all the children visible, but respect their disable state. */
|
/* Make all the children visible, but respect their disable state. */
|
||||||
layer_collection_flag_unset_recursive(lc, LAYER_COLLECTION_RESTRICT_VIEW);
|
layer_collection_flag_unset_recursive(lc, LAYER_COLLECTION_HIDE);
|
||||||
|
|
||||||
BKE_layer_collection_activate(view_layer, lc);
|
BKE_layer_collection_activate(view_layer, lc);
|
||||||
}
|
}
|
||||||
@@ -1109,27 +1109,27 @@ bool BKE_layer_collection_set_visible(ViewLayer *view_layer,
|
|||||||
bool depsgraph_changed = false;
|
bool depsgraph_changed = false;
|
||||||
|
|
||||||
if (visible && (!ID_IS_LINKED(lc->collection)) &&
|
if (visible && (!ID_IS_LINKED(lc->collection)) &&
|
||||||
((lc->collection->flag & COLLECTION_RESTRICT_INSTANCE) != 0)) {
|
((lc->collection->flag & COLLECTION_RESTRICT_VIEWPORT) != 0)) {
|
||||||
lc->collection->flag &= ~COLLECTION_RESTRICT_INSTANCE;
|
lc->collection->flag &= ~COLLECTION_RESTRICT_VIEWPORT;
|
||||||
depsgraph_changed = true;
|
depsgraph_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hierarchy) {
|
if (hierarchy) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
layer_collection_flag_unset_recursive(lc, LAYER_COLLECTION_RESTRICT_VIEW);
|
layer_collection_flag_unset_recursive(lc, LAYER_COLLECTION_HIDE);
|
||||||
layer_collection_bases_show_recursive(view_layer, lc);
|
layer_collection_bases_show_recursive(view_layer, lc);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
layer_collection_flag_set_recursive(lc, LAYER_COLLECTION_RESTRICT_VIEW);
|
layer_collection_flag_set_recursive(lc, LAYER_COLLECTION_HIDE);
|
||||||
layer_collection_bases_hide_recursive(view_layer, lc);
|
layer_collection_bases_hide_recursive(view_layer, lc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
lc->flag &= ~LAYER_COLLECTION_RESTRICT_VIEW;
|
lc->flag &= ~LAYER_COLLECTION_HIDE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lc->flag |= LAYER_COLLECTION_RESTRICT_VIEW;
|
lc->flag |= LAYER_COLLECTION_HIDE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return depsgraph_changed;
|
return depsgraph_changed;
|
||||||
@@ -1491,7 +1491,7 @@ void BKE_base_eval_flags(Base *base)
|
|||||||
|
|
||||||
/* Apply object restrictions. */
|
/* Apply object restrictions. */
|
||||||
const int object_restrict = base->object->restrictflag;
|
const int object_restrict = base->object->restrictflag;
|
||||||
if (object_restrict & OB_RESTRICT_INSTANCE) {
|
if (object_restrict & OB_RESTRICT_VIEWPORT) {
|
||||||
base->flag &= ~BASE_ENABLED_VIEWPORT;
|
base->flag &= ~BASE_ENABLED_VIEWPORT;
|
||||||
}
|
}
|
||||||
if (object_restrict & OB_RESTRICT_RENDER) {
|
if (object_restrict & OB_RESTRICT_RENDER) {
|
||||||
|
|||||||
@@ -1082,7 +1082,7 @@ static const DupliGenerator *get_dupli_generator(const DupliContext *ctx)
|
|||||||
|
|
||||||
/* Should the dupli's be generated for this object? - Respect restrict flags */
|
/* Should the dupli's be generated for this object? - Respect restrict flags */
|
||||||
if (DEG_get_mode(ctx->depsgraph) == DAG_EVAL_RENDER ? (restrictflag & OB_RESTRICT_RENDER) :
|
if (DEG_get_mode(ctx->depsgraph) == DAG_EVAL_RENDER ? (restrictflag & OB_RESTRICT_RENDER) :
|
||||||
(restrictflag & OB_RESTRICT_INSTANCE)) {
|
(restrictflag & OB_RESTRICT_VIEWPORT)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -427,7 +427,7 @@ static void do_version_layers_to_collections(Main *bmain, Scene *scene)
|
|||||||
collections[layer] = collection;
|
collections[layer] = collection;
|
||||||
|
|
||||||
if (!(scene->lay & (1 << layer))) {
|
if (!(scene->lay & (1 << layer))) {
|
||||||
collection->flag |= COLLECTION_RESTRICT_INSTANCE | COLLECTION_RESTRICT_RENDER;
|
collection->flag |= COLLECTION_RESTRICT_VIEWPORT | COLLECTION_RESTRICT_RENDER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -728,7 +728,7 @@ void do_versions_after_linking_280(Main *bmain)
|
|||||||
/* Add fake user for all existing groups. */
|
/* Add fake user for all existing groups. */
|
||||||
id_fake_user_set(&collection->id);
|
id_fake_user_set(&collection->id);
|
||||||
|
|
||||||
if (collection->flag & (COLLECTION_RESTRICT_INSTANCE | COLLECTION_RESTRICT_RENDER)) {
|
if (collection->flag & (COLLECTION_RESTRICT_VIEWPORT | COLLECTION_RESTRICT_RENDER)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -754,7 +754,7 @@ void do_versions_after_linking_280(Main *bmain)
|
|||||||
char name[MAX_ID_NAME];
|
char name[MAX_ID_NAME];
|
||||||
BLI_snprintf(name, sizeof(name), DATA_("Hidden %d"), coll_idx + 1);
|
BLI_snprintf(name, sizeof(name), DATA_("Hidden %d"), coll_idx + 1);
|
||||||
*collection_hidden = BKE_collection_add(bmain, collection, name);
|
*collection_hidden = BKE_collection_add(bmain, collection, name);
|
||||||
(*collection_hidden)->flag |= COLLECTION_RESTRICT_INSTANCE |
|
(*collection_hidden)->flag |= COLLECTION_RESTRICT_VIEWPORT |
|
||||||
COLLECTION_RESTRICT_RENDER;
|
COLLECTION_RESTRICT_RENDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3407,8 +3407,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
SpaceOutliner *so = (SpaceOutliner *)sl;
|
SpaceOutliner *so = (SpaceOutliner *)sl;
|
||||||
so->filter &= ~SO_FLAG_UNUSED_1;
|
so->filter &= ~SO_FLAG_UNUSED_1;
|
||||||
so->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_SELECTABLE |
|
so->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_SELECT | SO_RESTRICT_VIEWPORT;
|
||||||
SO_RESTRICT_VIEWPORT;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -463,7 +463,7 @@ void DepsgraphNodeBuilder::build_id(ID *id)
|
|||||||
void DepsgraphNodeBuilder::build_collection(LayerCollection *from_layer_collection,
|
void DepsgraphNodeBuilder::build_collection(LayerCollection *from_layer_collection,
|
||||||
Collection *collection)
|
Collection *collection)
|
||||||
{
|
{
|
||||||
const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? COLLECTION_RESTRICT_INSTANCE :
|
const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? COLLECTION_RESTRICT_VIEWPORT :
|
||||||
COLLECTION_RESTRICT_RENDER;
|
COLLECTION_RESTRICT_RENDER;
|
||||||
const bool is_collection_restricted = (collection->flag & restrict_flag);
|
const bool is_collection_restricted = (collection->flag & restrict_flag);
|
||||||
const bool is_collection_visible = !is_collection_restricted && is_parent_collection_visible_;
|
const bool is_collection_visible = !is_collection_restricted && is_parent_collection_visible_;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace DEG {
|
|||||||
|
|
||||||
void DepsgraphNodeBuilder::build_layer_collections(ListBase *lb)
|
void DepsgraphNodeBuilder::build_layer_collections(ListBase *lb)
|
||||||
{
|
{
|
||||||
const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? COLLECTION_RESTRICT_INSTANCE :
|
const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? COLLECTION_RESTRICT_VIEWPORT :
|
||||||
COLLECTION_RESTRICT_RENDER;
|
COLLECTION_RESTRICT_RENDER;
|
||||||
|
|
||||||
for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) {
|
for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ namespace DEG {
|
|||||||
|
|
||||||
void DepsgraphRelationBuilder::build_layer_collections(ListBase *lb)
|
void DepsgraphRelationBuilder::build_layer_collections(ListBase *lb)
|
||||||
{
|
{
|
||||||
const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? COLLECTION_RESTRICT_INSTANCE :
|
const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? COLLECTION_RESTRICT_VIEWPORT :
|
||||||
COLLECTION_RESTRICT_RENDER;
|
COLLECTION_RESTRICT_RENDER;
|
||||||
|
|
||||||
for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) {
|
for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) {
|
||||||
|
|||||||
@@ -1823,7 +1823,7 @@ static size_t animdata_filter_gpencil(bAnimContext *ac,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* outliner restrict-flag */
|
/* outliner restrict-flag */
|
||||||
if (ob->restrictflag & OB_RESTRICT_INSTANCE) {
|
if (ob->restrictflag & OB_RESTRICT_VIEWPORT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3022,7 +3022,7 @@ static bool animdata_filter_base_is_ok(bDopeSheet *ads, Base *base, int filter_m
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* outliner restrict-flag */
|
/* outliner restrict-flag */
|
||||||
if (ob->restrictflag & OB_RESTRICT_INSTANCE) {
|
if (ob->restrictflag & OB_RESTRICT_VIEWPORT) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1992,9 +1992,9 @@ static int mask_hide_view_clear_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) {
|
for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) {
|
||||||
|
|
||||||
if (masklay->restrictflag & OB_RESTRICT_INSTANCE) {
|
if (masklay->restrictflag & OB_RESTRICT_VIEWPORT) {
|
||||||
ED_mask_layer_select_set(masklay, select);
|
ED_mask_layer_select_set(masklay, select);
|
||||||
masklay->restrictflag &= ~OB_RESTRICT_INSTANCE;
|
masklay->restrictflag &= ~OB_RESTRICT_VIEWPORT;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2045,7 +2045,7 @@ static int mask_hide_view_set_exec(bContext *C, wmOperator *op)
|
|||||||
if (ED_mask_layer_select_check(masklay)) {
|
if (ED_mask_layer_select_check(masklay)) {
|
||||||
ED_mask_layer_select_set(masklay, false);
|
ED_mask_layer_select_set(masklay, false);
|
||||||
|
|
||||||
masklay->restrictflag |= OB_RESTRICT_INSTANCE;
|
masklay->restrictflag |= OB_RESTRICT_VIEWPORT;
|
||||||
changed = true;
|
changed = true;
|
||||||
if (masklay == BKE_mask_layer_active(mask)) {
|
if (masklay == BKE_mask_layer_active(mask)) {
|
||||||
BKE_mask_layer_active_set(mask, NULL);
|
BKE_mask_layer_active_set(mask, NULL);
|
||||||
@@ -2054,7 +2054,7 @@ static int mask_hide_view_set_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!ED_mask_layer_select_check(masklay)) {
|
if (!ED_mask_layer_select_check(masklay)) {
|
||||||
masklay->restrictflag |= OB_RESTRICT_INSTANCE;
|
masklay->restrictflag |= OB_RESTRICT_VIEWPORT;
|
||||||
changed = true;
|
changed = true;
|
||||||
if (masklay == BKE_mask_layer_active(mask)) {
|
if (masklay == BKE_mask_layer_active(mask)) {
|
||||||
BKE_mask_layer_active_set(mask, NULL);
|
BKE_mask_layer_active_set(mask, NULL);
|
||||||
|
|||||||
@@ -2475,7 +2475,7 @@ static int add_named_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
basen->object->restrictflag &= ~OB_RESTRICT_INSTANCE;
|
basen->object->restrictflag &= ~OB_RESTRICT_VIEWPORT;
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
ARegion *ar = CTX_wm_region(C);
|
ARegion *ar = CTX_wm_region(C);
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ void ED_collection_hide_menu_draw(const bContext *C, uiLayout *layout)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lc->collection->flag & COLLECTION_RESTRICT_INSTANCE) {
|
if (lc->collection->flag & COLLECTION_RESTRICT_VIEWPORT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -722,7 +722,7 @@ static bool editmode_toggle_poll(bContext *C)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* if hidden but in edit mode, we still display */
|
/* if hidden but in edit mode, we still display */
|
||||||
if ((ob->restrictflag & OB_RESTRICT_INSTANCE) && !(ob->mode & OB_MODE_EDIT)) {
|
if ((ob->restrictflag & OB_RESTRICT_VIEWPORT) && !(ob->mode & OB_MODE_EDIT)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ bool ED_operator_console_active(bContext *C)
|
|||||||
static bool ed_object_hidden(Object *ob)
|
static bool ed_object_hidden(Object *ob)
|
||||||
{
|
{
|
||||||
/* if hidden but in edit mode, we still display, can happen with animation */
|
/* if hidden but in edit mode, we still display, can happen with animation */
|
||||||
return ((ob->restrictflag & OB_RESTRICT_INSTANCE) && !(ob->mode & OB_MODE_EDIT));
|
return ((ob->restrictflag & OB_RESTRICT_VIEWPORT) && !(ob->mode & OB_MODE_EDIT));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ED_operator_object_active(bContext *C)
|
bool ED_operator_object_active(bContext *C)
|
||||||
|
|||||||
@@ -965,8 +965,8 @@ static int collection_isolate_exec(bContext *C, wmOperator *op)
|
|||||||
LayerCollection *lc_master = view_layer->layer_collections.first;
|
LayerCollection *lc_master = view_layer->layer_collections.first;
|
||||||
for (LayerCollection *lc_iter = lc_master->layer_collections.first; lc_iter;
|
for (LayerCollection *lc_iter = lc_master->layer_collections.first; lc_iter;
|
||||||
lc_iter = lc_iter->next) {
|
lc_iter = lc_iter->next) {
|
||||||
lc_iter->flag |= LAYER_COLLECTION_RESTRICT_VIEW;
|
lc_iter->flag |= LAYER_COLLECTION_HIDE;
|
||||||
layer_collection_flag_recursive_set(lc_iter, LAYER_COLLECTION_RESTRICT_VIEW);
|
layer_collection_flag_recursive_set(lc_iter, LAYER_COLLECTION_HIDE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1023,12 +1023,12 @@ void OUTLINER_OT_collection_isolate(wmOperatorType *ot)
|
|||||||
|
|
||||||
static bool collection_show_poll(bContext *C)
|
static bool collection_show_poll(bContext *C)
|
||||||
{
|
{
|
||||||
return collections_view_layer_poll(C, true, LAYER_COLLECTION_RESTRICT_VIEW);
|
return collections_view_layer_poll(C, true, LAYER_COLLECTION_HIDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool collection_hide_poll(bContext *C)
|
static bool collection_hide_poll(bContext *C)
|
||||||
{
|
{
|
||||||
return collections_view_layer_poll(C, false, LAYER_COLLECTION_RESTRICT_VIEW);
|
return collections_view_layer_poll(C, false, LAYER_COLLECTION_HIDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool collection_inside_poll(bContext *C)
|
static bool collection_inside_poll(bContext *C)
|
||||||
@@ -1163,12 +1163,12 @@ static bool collection_flag_poll(bContext *C, bool clear, int flag)
|
|||||||
|
|
||||||
static bool collection_enable_poll(bContext *C)
|
static bool collection_enable_poll(bContext *C)
|
||||||
{
|
{
|
||||||
return collection_flag_poll(C, true, COLLECTION_RESTRICT_INSTANCE);
|
return collection_flag_poll(C, true, COLLECTION_RESTRICT_VIEWPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool collection_disable_poll(bContext *C)
|
static bool collection_disable_poll(bContext *C)
|
||||||
{
|
{
|
||||||
return collection_flag_poll(C, false, COLLECTION_RESTRICT_INSTANCE);
|
return collection_flag_poll(C, false, COLLECTION_RESTRICT_VIEWPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool collection_enable_render_poll(bContext *C)
|
static bool collection_enable_render_poll(bContext *C)
|
||||||
@@ -1188,7 +1188,7 @@ static int collection_flag_exec(bContext *C, wmOperator *op)
|
|||||||
SpaceOutliner *soops = CTX_wm_space_outliner(C);
|
SpaceOutliner *soops = CTX_wm_space_outliner(C);
|
||||||
const bool is_render = strstr(op->idname, "render");
|
const bool is_render = strstr(op->idname, "render");
|
||||||
const bool clear = strstr(op->idname, "show") || strstr(op->idname, "enable");
|
const bool clear = strstr(op->idname, "show") || strstr(op->idname, "enable");
|
||||||
int flag = is_render ? COLLECTION_RESTRICT_RENDER : COLLECTION_RESTRICT_INSTANCE;
|
int flag = is_render ? COLLECTION_RESTRICT_RENDER : COLLECTION_RESTRICT_VIEWPORT;
|
||||||
struct CollectionEditData data = {
|
struct CollectionEditData data = {
|
||||||
.scene = scene,
|
.scene = scene,
|
||||||
.soops = soops,
|
.soops = soops,
|
||||||
@@ -1215,7 +1215,7 @@ static int collection_flag_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* Make sure (at least for this view layer) the collection is visible. */
|
/* Make sure (at least for this view layer) the collection is visible. */
|
||||||
if (clear && !is_render) {
|
if (clear && !is_render) {
|
||||||
layer_collection->flag &= ~LAYER_COLLECTION_RESTRICT_VIEW;
|
layer_collection->flag &= ~LAYER_COLLECTION_HIDE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BLI_gset_free(data.collections_to_edit, NULL);
|
BLI_gset_free(data.collections_to_edit, NULL);
|
||||||
@@ -1408,8 +1408,8 @@ static int outliner_unhide_all_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
LayerCollection *lc_master = view_layer->layer_collections.first;
|
LayerCollection *lc_master = view_layer->layer_collections.first;
|
||||||
for (LayerCollection *lc_iter = lc_master->layer_collections.first; lc_iter;
|
for (LayerCollection *lc_iter = lc_master->layer_collections.first; lc_iter;
|
||||||
lc_iter = lc_iter->next) {
|
lc_iter = lc_iter->next) {
|
||||||
lc_iter->flag &= ~LAYER_COLLECTION_RESTRICT_VIEW;
|
lc_iter->flag &= ~LAYER_COLLECTION_HIDE;
|
||||||
layer_collection_flag_recursive_set(lc_iter, LAYER_COLLECTION_RESTRICT_VIEW);
|
layer_collection_flag_recursive_set(lc_iter, LAYER_COLLECTION_HIDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unhide all objects. */
|
/* Unhide all objects. */
|
||||||
|
|||||||
@@ -287,12 +287,12 @@ static void hidebutton_base_flag_cb(bContext *C, void *poin, void *poin2)
|
|||||||
|
|
||||||
if (do_disable) {
|
if (do_disable) {
|
||||||
if (!is_linked) {
|
if (!is_linked) {
|
||||||
ob->restrictflag |= OB_RESTRICT_INSTANCE;
|
ob->restrictflag |= OB_RESTRICT_VIEWPORT;
|
||||||
depsgraph_changed = true;
|
depsgraph_changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (do_isolate) {
|
else if (do_isolate) {
|
||||||
depsgraph_changed = (!is_linked) && ((ob->restrictflag & OB_RESTRICT_INSTANCE) != 0);
|
depsgraph_changed = (!is_linked) && ((ob->restrictflag & OB_RESTRICT_VIEWPORT) != 0);
|
||||||
|
|
||||||
if (!extend) {
|
if (!extend) {
|
||||||
/* Make only one base visible. */
|
/* Make only one base visible. */
|
||||||
@@ -308,12 +308,12 @@ static void hidebutton_base_flag_cb(bContext *C, void *poin, void *poin2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!is_linked) {
|
if (!is_linked) {
|
||||||
ob->restrictflag &= ~OB_RESTRICT_INSTANCE;
|
ob->restrictflag &= ~OB_RESTRICT_VIEWPORT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ob->restrictflag & OB_RESTRICT_INSTANCE) {
|
else if (ob->restrictflag & OB_RESTRICT_VIEWPORT) {
|
||||||
if (!is_linked) {
|
if (!is_linked) {
|
||||||
ob->restrictflag &= ~OB_RESTRICT_INSTANCE;
|
ob->restrictflag &= ~OB_RESTRICT_VIEWPORT;
|
||||||
base->flag &= ~BASE_HIDDEN;
|
base->flag &= ~BASE_HIDDEN;
|
||||||
}
|
}
|
||||||
depsgraph_changed = true;
|
depsgraph_changed = true;
|
||||||
@@ -889,8 +889,8 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
|
|
||||||
struct {
|
struct {
|
||||||
int select;
|
int select;
|
||||||
|
int hide;
|
||||||
int viewport;
|
int viewport;
|
||||||
int instance;
|
|
||||||
int render;
|
int render;
|
||||||
int indirect_only;
|
int indirect_only;
|
||||||
int holdout;
|
int holdout;
|
||||||
@@ -909,13 +909,13 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
if (soops->show_restrict_flags & SO_RESTRICT_RENDER) {
|
if (soops->show_restrict_flags & SO_RESTRICT_RENDER) {
|
||||||
restrict_offsets.render = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH;
|
restrict_offsets.render = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH;
|
||||||
}
|
}
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_INSTANCE) {
|
|
||||||
restrict_offsets.instance = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH;
|
|
||||||
}
|
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) {
|
if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) {
|
||||||
restrict_offsets.viewport = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH;
|
restrict_offsets.viewport = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH;
|
||||||
}
|
}
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_SELECTABLE) {
|
if (soops->show_restrict_flags & SO_RESTRICT_HIDE) {
|
||||||
|
restrict_offsets.hide = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH;
|
||||||
|
}
|
||||||
|
if (soops->show_restrict_flags & SO_RESTRICT_SELECT) {
|
||||||
restrict_offsets.select = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH;
|
restrict_offsets.select = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH;
|
||||||
}
|
}
|
||||||
BLI_assert((restrict_column_offset * UI_UNIT_X + V2D_SCROLL_WIDTH) ==
|
BLI_assert((restrict_column_offset * UI_UNIT_X + V2D_SCROLL_WIDTH) ==
|
||||||
@@ -961,7 +961,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
Object *ob = (Object *)tselem->id;
|
Object *ob = (Object *)tselem->id;
|
||||||
RNA_id_pointer_create(&ob->id, &ptr);
|
RNA_id_pointer_create(&ob->id, &ptr);
|
||||||
|
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) {
|
if (soops->show_restrict_flags & SO_RESTRICT_HIDE) {
|
||||||
Base *base = (te->directdata) ? (Base *)te->directdata :
|
Base *base = (te->directdata) ? (Base *)te->directdata :
|
||||||
BKE_view_layer_base_find(view_layer, ob);
|
BKE_view_layer_base_find(view_layer, ob);
|
||||||
if (base) {
|
if (base) {
|
||||||
@@ -971,7 +971,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
UI_BTYPE_ICON_TOGGLE,
|
UI_BTYPE_ICON_TOGGLE,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
(int)(ar->v2d.cur.xmax - restrict_offsets.viewport),
|
(int)(ar->v2d.cur.xmax - restrict_offsets.hide),
|
||||||
te->ys,
|
te->ys,
|
||||||
UI_UNIT_X,
|
UI_UNIT_X,
|
||||||
UI_UNIT_Y,
|
UI_UNIT_Y,
|
||||||
@@ -990,7 +990,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
UI_BTYPE_ICON_TOGGLE,
|
UI_BTYPE_ICON_TOGGLE,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
(int)(ar->v2d.cur.xmax - restrict_offsets.viewport),
|
(int)(ar->v2d.cur.xmax - restrict_offsets.hide),
|
||||||
te->ys,
|
te->ys,
|
||||||
UI_UNIT_X,
|
UI_UNIT_X,
|
||||||
UI_UNIT_Y,
|
UI_UNIT_Y,
|
||||||
@@ -1006,7 +1006,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_SELECTABLE) {
|
if (soops->show_restrict_flags & SO_RESTRICT_SELECT) {
|
||||||
bt = uiDefIconButR_prop(block,
|
bt = uiDefIconButR_prop(block,
|
||||||
UI_BTYPE_ICON_TOGGLE,
|
UI_BTYPE_ICON_TOGGLE,
|
||||||
0,
|
0,
|
||||||
@@ -1026,12 +1026,12 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
|
UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_INSTANCE) {
|
if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) {
|
||||||
bt = uiDefIconButR_prop(block,
|
bt = uiDefIconButR_prop(block,
|
||||||
UI_BTYPE_ICON_TOGGLE,
|
UI_BTYPE_ICON_TOGGLE,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
(int)(ar->v2d.cur.xmax - restrict_offsets.instance),
|
(int)(ar->v2d.cur.xmax - restrict_offsets.viewport),
|
||||||
te->ys,
|
te->ys,
|
||||||
UI_UNIT_X,
|
UI_UNIT_X,
|
||||||
UI_UNIT_Y,
|
UI_UNIT_Y,
|
||||||
@@ -1138,7 +1138,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE);
|
UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_SELECTABLE) {
|
if (soops->show_restrict_flags & SO_RESTRICT_SELECT) {
|
||||||
bt = uiDefIconButBitI(block,
|
bt = uiDefIconButBitI(block,
|
||||||
UI_BTYPE_ICON_TOGGLE,
|
UI_BTYPE_ICON_TOGGLE,
|
||||||
BONE_UNSELECTABLE,
|
BONE_UNSELECTABLE,
|
||||||
@@ -1183,7 +1183,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE);
|
UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_SELECTABLE) {
|
if (soops->show_restrict_flags & SO_RESTRICT_SELECT) {
|
||||||
bt = uiDefIconButBitI(block,
|
bt = uiDefIconButBitI(block,
|
||||||
UI_BTYPE_ICON_TOGGLE,
|
UI_BTYPE_ICON_TOGGLE,
|
||||||
BONE_UNSELECTABLE,
|
BONE_UNSELECTABLE,
|
||||||
@@ -1229,7 +1229,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE);
|
UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_SELECTABLE) {
|
if (soops->show_restrict_flags & SO_RESTRICT_SELECT) {
|
||||||
bt = uiDefIconButBitS(
|
bt = uiDefIconButBitS(
|
||||||
block,
|
block,
|
||||||
UI_BTYPE_ICON_TOGGLE,
|
UI_BTYPE_ICON_TOGGLE,
|
||||||
@@ -1266,12 +1266,12 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
RNA_pointer_create(
|
RNA_pointer_create(
|
||||||
&scene->id, &RNA_LayerCollection, layer_collection, &layer_collection_ptr);
|
&scene->id, &RNA_LayerCollection, layer_collection, &layer_collection_ptr);
|
||||||
|
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) {
|
if (soops->show_restrict_flags & SO_RESTRICT_HIDE) {
|
||||||
bt = uiDefIconButR_prop(block,
|
bt = uiDefIconButR_prop(block,
|
||||||
UI_BTYPE_ICON_TOGGLE,
|
UI_BTYPE_ICON_TOGGLE,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
(int)(ar->v2d.cur.xmax - restrict_offsets.viewport),
|
(int)(ar->v2d.cur.xmax - restrict_offsets.hide),
|
||||||
te->ys,
|
te->ys,
|
||||||
UI_UNIT_X,
|
UI_UNIT_X,
|
||||||
UI_UNIT_Y,
|
UI_UNIT_Y,
|
||||||
@@ -1347,12 +1347,12 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_INSTANCE) {
|
if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) {
|
||||||
bt = uiDefIconButR_prop(block,
|
bt = uiDefIconButR_prop(block,
|
||||||
UI_BTYPE_ICON_TOGGLE,
|
UI_BTYPE_ICON_TOGGLE,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
(int)(ar->v2d.cur.xmax - restrict_offsets.instance),
|
(int)(ar->v2d.cur.xmax - restrict_offsets.viewport),
|
||||||
te->ys,
|
te->ys,
|
||||||
UI_UNIT_X,
|
UI_UNIT_X,
|
||||||
UI_UNIT_Y,
|
UI_UNIT_Y,
|
||||||
@@ -1413,7 +1413,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
|
|||||||
UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
|
UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_SELECTABLE) {
|
if (soops->show_restrict_flags & SO_RESTRICT_SELECT) {
|
||||||
bt = uiDefIconButR_prop(block,
|
bt = uiDefIconButR_prop(block,
|
||||||
UI_BTYPE_ICON_TOGGLE,
|
UI_BTYPE_ICON_TOGGLE,
|
||||||
0,
|
0,
|
||||||
|
|||||||
@@ -1025,8 +1025,8 @@ int common_restrict_check(bContext *C, Object *ob)
|
|||||||
Object *obedit = CTX_data_edit_object(C);
|
Object *obedit = CTX_data_edit_object(C);
|
||||||
if (obedit && obedit == ob) {
|
if (obedit && obedit == ob) {
|
||||||
/* found object is hidden, reset */
|
/* found object is hidden, reset */
|
||||||
if (ob->restrictflag & OB_RESTRICT_INSTANCE) {
|
if (ob->restrictflag & OB_RESTRICT_VIEWPORT) {
|
||||||
ob->restrictflag &= ~OB_RESTRICT_INSTANCE;
|
ob->restrictflag &= ~OB_RESTRICT_VIEWPORT;
|
||||||
}
|
}
|
||||||
/* found object is unselectable, reset */
|
/* found object is unselectable, reset */
|
||||||
if (ob->restrictflag & OB_RESTRICT_SELECT) {
|
if (ob->restrictflag & OB_RESTRICT_SELECT) {
|
||||||
|
|||||||
@@ -283,13 +283,13 @@ float outliner_restrict_columns_width(const SpaceOutliner *soops)
|
|||||||
}
|
}
|
||||||
ATTR_FALLTHROUGH;
|
ATTR_FALLTHROUGH;
|
||||||
case SO_SCENES:
|
case SO_SCENES:
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_SELECTABLE) {
|
if (soops->show_restrict_flags & SO_RESTRICT_SELECT) {
|
||||||
num_columns++;
|
num_columns++;
|
||||||
}
|
}
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) {
|
if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) {
|
||||||
num_columns++;
|
num_columns++;
|
||||||
}
|
}
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_INSTANCE) {
|
if (soops->show_restrict_flags & SO_RESTRICT_HIDE) {
|
||||||
num_columns++;
|
num_columns++;
|
||||||
}
|
}
|
||||||
if (soops->show_restrict_flags & SO_RESTRICT_RENDER) {
|
if (soops->show_restrict_flags & SO_RESTRICT_RENDER) {
|
||||||
|
|||||||
@@ -302,8 +302,7 @@ static SpaceLink *outliner_new(const ScrArea *UNUSED(area), const Scene *UNUSED(
|
|||||||
soutliner = MEM_callocN(sizeof(SpaceOutliner), "initoutliner");
|
soutliner = MEM_callocN(sizeof(SpaceOutliner), "initoutliner");
|
||||||
soutliner->spacetype = SPACE_OUTLINER;
|
soutliner->spacetype = SPACE_OUTLINER;
|
||||||
soutliner->filter_id_type = ID_GR;
|
soutliner->filter_id_type = ID_GR;
|
||||||
soutliner->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_SELECTABLE |
|
soutliner->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_SELECT | SO_RESTRICT_VIEWPORT;
|
||||||
SO_RESTRICT_VIEWPORT;
|
|
||||||
|
|
||||||
/* header */
|
/* header */
|
||||||
ar = MEM_callocN(sizeof(ARegion), "header for outliner");
|
ar = MEM_callocN(sizeof(ARegion), "header for outliner");
|
||||||
|
|||||||
@@ -76,10 +76,10 @@ typedef struct Collection {
|
|||||||
|
|
||||||
/* Collection->flag */
|
/* Collection->flag */
|
||||||
enum {
|
enum {
|
||||||
COLLECTION_RESTRICT_INSTANCE = (1 << 0), /* Hidden in viewport. */
|
COLLECTION_RESTRICT_VIEWPORT = (1 << 0), /* Disable in viewports. */
|
||||||
COLLECTION_RESTRICT_SELECT = (1 << 1), /* Not selectable in viewport. */
|
COLLECTION_RESTRICT_SELECT = (1 << 1), /* Not selectable in viewport. */
|
||||||
COLLECTION_DISABLED_DEPRECATED = (1 << 2), /* Not used anymore */
|
COLLECTION_DISABLED_DEPRECATED = (1 << 2), /* Not used anymore */
|
||||||
COLLECTION_RESTRICT_RENDER = (1 << 3), /* Hidden in renders. */
|
COLLECTION_RESTRICT_RENDER = (1 << 3), /* Disable in renders. */
|
||||||
COLLECTION_HAS_OBJECT_CACHE = (1 << 4), /* Runtime: object_cache is populated. */
|
COLLECTION_HAS_OBJECT_CACHE = (1 << 4), /* Runtime: object_cache is populated. */
|
||||||
COLLECTION_IS_MASTER = (1 << 5), /* Is master collection embedded in the scene. */
|
COLLECTION_IS_MASTER = (1 << 5), /* Is master collection embedded in the scene. */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ enum {
|
|||||||
LAYER_COLLECTION_EXCLUDE = (1 << 4),
|
LAYER_COLLECTION_EXCLUDE = (1 << 4),
|
||||||
LAYER_COLLECTION_HOLDOUT = (1 << 5),
|
LAYER_COLLECTION_HOLDOUT = (1 << 5),
|
||||||
LAYER_COLLECTION_INDIRECT_ONLY = (1 << 6),
|
LAYER_COLLECTION_INDIRECT_ONLY = (1 << 6),
|
||||||
LAYER_COLLECTION_RESTRICT_VIEW = (1 << 7),
|
LAYER_COLLECTION_HIDE = (1 << 7),
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Layer Collection->runtime_flag */
|
/* Layer Collection->runtime_flag */
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ enum {
|
|||||||
|
|
||||||
/* ob->restrictflag */
|
/* ob->restrictflag */
|
||||||
enum {
|
enum {
|
||||||
OB_RESTRICT_INSTANCE = 1 << 0,
|
OB_RESTRICT_VIEWPORT = 1 << 0,
|
||||||
OB_RESTRICT_SELECT = 1 << 1,
|
OB_RESTRICT_SELECT = 1 << 1,
|
||||||
OB_RESTRICT_RENDER = 1 << 2,
|
OB_RESTRICT_RENDER = 1 << 2,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -312,8 +312,8 @@ typedef enum eSpaceOutliner_StateFilter {
|
|||||||
/* SpaceOutliner.show_restrict_flags */
|
/* SpaceOutliner.show_restrict_flags */
|
||||||
typedef enum eSpaceOutliner_ShowRestrictFlag {
|
typedef enum eSpaceOutliner_ShowRestrictFlag {
|
||||||
SO_RESTRICT_ENABLE = (1 << 0),
|
SO_RESTRICT_ENABLE = (1 << 0),
|
||||||
SO_RESTRICT_SELECTABLE = (1 << 1),
|
SO_RESTRICT_SELECT = (1 << 1),
|
||||||
SO_RESTRICT_INSTANCE = (1 << 2),
|
SO_RESTRICT_HIDE = (1 << 2),
|
||||||
SO_RESTRICT_VIEWPORT = (1 << 3),
|
SO_RESTRICT_VIEWPORT = (1 << 3),
|
||||||
SO_RESTRICT_RENDER = (1 << 4),
|
SO_RESTRICT_RENDER = (1 << 4),
|
||||||
SO_RESTRICT_HOLDOUT = (1 << 5),
|
SO_RESTRICT_HOLDOUT = (1 << 5),
|
||||||
|
|||||||
@@ -409,10 +409,10 @@ void RNA_def_collections(BlenderRNA *brna)
|
|||||||
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", COLLECTION_RESTRICT_INSTANCE);
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", COLLECTION_RESTRICT_VIEWPORT);
|
||||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
|
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
|
||||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||||
RNA_def_property_ui_icon(prop, ICON_LINKED, -1);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, -1);
|
||||||
RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
|
RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
|
||||||
|
|
||||||
|
|||||||
@@ -320,9 +320,9 @@ static void rna_def_layer_collection(BlenderRNA *brna)
|
|||||||
RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", LAYER_COLLECTION_RESTRICT_VIEW);
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", LAYER_COLLECTION_HIDE);
|
||||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
|
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
|
||||||
RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
|
RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, 1);
|
||||||
RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
|
RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollection_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollection_update");
|
||||||
|
|
||||||
@@ -408,7 +408,7 @@ static void rna_def_object_base(BlenderRNA *brna)
|
|||||||
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", BASE_HIDDEN);
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", BASE_HIDDEN);
|
||||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
|
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
|
||||||
RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
|
RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, 1);
|
||||||
RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
|
RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
|
||||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||||
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ObjectBase_hide_viewport_update");
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ObjectBase_hide_viewport_update");
|
||||||
|
|||||||
@@ -2801,10 +2801,10 @@ static void rna_def_object(BlenderRNA *brna)
|
|||||||
|
|
||||||
/* restrict */
|
/* restrict */
|
||||||
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_INSTANCE);
|
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEWPORT);
|
||||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
|
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
|
||||||
RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
|
RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
|
||||||
RNA_def_property_ui_icon(prop, ICON_LINKED, -1);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, -1);
|
||||||
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update");
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
|||||||
@@ -2788,22 +2788,22 @@ static void rna_def_space_outliner(BlenderRNA *brna)
|
|||||||
RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, 0);
|
RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, 0);
|
||||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
|
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "show_restrict_column_selectable", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "show_restrict_column_select", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "show_restrict_flags", SO_RESTRICT_SELECTABLE);
|
RNA_def_property_boolean_sdna(prop, NULL, "show_restrict_flags", SO_RESTRICT_SELECT);
|
||||||
RNA_def_property_ui_text(prop, "Selectable", "Selectable");
|
RNA_def_property_ui_text(prop, "Selectable", "Selectable");
|
||||||
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
|
||||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
|
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "show_restrict_column_viewport", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "show_restrict_column_hide", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "show_restrict_flags", SO_RESTRICT_VIEWPORT);
|
RNA_def_property_boolean_sdna(prop, NULL, "show_restrict_flags", SO_RESTRICT_HIDE);
|
||||||
RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
|
RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
|
||||||
RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, 0);
|
RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, 0);
|
||||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
|
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "show_restrict_column_instance", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "show_restrict_column_viewport", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "show_restrict_flags", SO_RESTRICT_INSTANCE);
|
RNA_def_property_boolean_sdna(prop, NULL, "show_restrict_flags", SO_RESTRICT_VIEWPORT);
|
||||||
RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
|
RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
|
||||||
RNA_def_property_ui_icon(prop, ICON_LINKED, 0);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0);
|
||||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
|
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "show_restrict_column_render", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "show_restrict_column_render", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
|||||||
Reference in New Issue
Block a user