Workbench: removed per collection object color
Will be part of the collection manager where per collection the ob->col can be set. This currently depends on DepsGraph + CollectionManager. I removed it for now so the code won't influence development
This commit is contained in:
@@ -86,19 +86,6 @@ class COLLECTION_PT_clay_settings(CollectionButtonsPanel, Panel):
|
||||
col.template_override_property(collection_props, scene_props, "hair_brightness_randomness")
|
||||
|
||||
|
||||
class COLLECTION_PT_workbench_settings(CollectionButtonsPanel, Panel):
|
||||
bl_label = "Collection Settings"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
scene_props = context.scene.collection_properties['BLENDER_WORKBENCH']
|
||||
collection = get_collection_from_context(context)
|
||||
collection_props = collection.engine_overrides['BLENDER_WORKBENCH']
|
||||
|
||||
col = layout.column()
|
||||
col.template_override_property(collection_props, scene_props, "object_color")
|
||||
|
||||
|
||||
class COLLECTION_PT_object_mode_settings(CollectionButtonsPanel, Panel):
|
||||
bl_label = "Object Mode Settings"
|
||||
|
||||
@@ -183,7 +170,6 @@ class COLLECTION_PT_paint_vertex_mode_settings(CollectionButtonsPanel, Panel):
|
||||
classes = (
|
||||
COLLECTION_PT_context_collection,
|
||||
COLLECTION_PT_clay_settings,
|
||||
COLLECTION_PT_workbench_settings,
|
||||
COLLECTION_PT_object_mode_settings,
|
||||
COLLECTION_PT_edit_mode_settings,
|
||||
COLLECTION_PT_paint_weight_mode_settings,
|
||||
|
||||
@@ -48,8 +48,6 @@ static void workbench_layer_collection_settings_create(RenderEngine *UNUSED(engi
|
||||
BLI_assert(props &&
|
||||
props->type == IDP_GROUP &&
|
||||
props->subtype == IDP_GROUP_SUB_ENGINE_RENDER);
|
||||
float default_object_color[3] = {1.0, 1.0, 1.0};
|
||||
BKE_collection_engine_property_add_float_array(props, "object_color", default_object_color, 3);
|
||||
}
|
||||
|
||||
/* Note: currently unused, we may want to register so we can see this when debugging the view. */
|
||||
|
||||
@@ -57,16 +57,7 @@ static uint get_material_hash(const float color[3])
|
||||
|
||||
static const float* get_material_solid_color(WORKBENCH_PrivateData *wpd, Object *ob)
|
||||
{
|
||||
IDProperty *props = BKE_layer_collection_engine_evaluated_get(ob, COLLECTION_MODE_NONE, RE_engine_id_BLENDER_WORKBENCH);
|
||||
switch (wpd->drawtype_object_color)
|
||||
{
|
||||
default:
|
||||
case V3D_OBJECT_COLOR_COLLECTION:
|
||||
return BKE_collection_engine_property_value_get_float_array(props, "object_color");
|
||||
|
||||
case V3D_OBJECT_COLOR_OBJECT:
|
||||
return ob->col;
|
||||
}
|
||||
return ob->col;
|
||||
}
|
||||
|
||||
void workbench_materials_engine_init(void)
|
||||
@@ -110,7 +101,6 @@ void workbench_materials_cache_init(WORKBENCH_Data *vedata)
|
||||
|
||||
View3D *v3d = DCS->v3d;
|
||||
if (v3d) {
|
||||
wpd->drawtype_object_color = v3d->drawtype_object_color;
|
||||
#if 0
|
||||
/* TODO: switch implementation when OB_TEXTURE is implemented */
|
||||
switch (v3d->drawtype) {
|
||||
@@ -124,7 +114,6 @@ void workbench_materials_cache_init(WORKBENCH_Data *vedata)
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
wpd->drawtype_object_color = V3D_OBJECT_COLOR_COLLECTION;
|
||||
wpd->drawtype_lighting = V3D_LIGHTING_STUDIO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,6 @@ typedef struct WORKBENCH_PrivateData {
|
||||
DRWShadingGroup *shadeless_shgrp;
|
||||
|
||||
struct GHash *material_hash;
|
||||
short drawtype_object_color;
|
||||
short drawtype_lighting;
|
||||
} WORKBENCH_PrivateData; /* Transient data */
|
||||
|
||||
|
||||
@@ -307,7 +307,6 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
|
||||
uiItemR(layout, &v3dptr, "viewport_shade", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
|
||||
if (v3d->drawtype == OB_SOLID) {
|
||||
uiItemR(layout, &v3dptr, "viewport_shade_solid", 0, "", ICON_NONE);
|
||||
uiItemR(layout, &v3dptr, "viewport_object_color_type", 0, "", ICON_NONE);
|
||||
}
|
||||
|
||||
row = uiLayoutRow(layout, true);
|
||||
|
||||
@@ -80,11 +80,6 @@ enum {
|
||||
V3D_LIGHTING_SCENE = 2
|
||||
};
|
||||
|
||||
enum {
|
||||
V3D_OBJECT_COLOR_COLLECTION = 0,
|
||||
V3D_OBJECT_COLOR_OBJECT = 1,
|
||||
};
|
||||
|
||||
typedef struct RegionView3D {
|
||||
|
||||
float winmat[4][4]; /* GL_PROJECTION matrix */
|
||||
@@ -252,9 +247,7 @@ typedef struct View3D {
|
||||
short drawtype_solid;
|
||||
/* drawtype subtype (lighting) used when drawtype == OB_TEXTURE */
|
||||
short drawtype_texture;
|
||||
/* how to draw objects when drawtype == OB_SOLID */
|
||||
short drawtype_object_color;
|
||||
char pad5[6];
|
||||
|
||||
View3DDebug debug;
|
||||
} View3D;
|
||||
|
||||
|
||||
@@ -360,10 +360,6 @@ RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_attenuation)
|
||||
RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(hair_brightness_randomness)
|
||||
#endif /* WITH_CLAY_ENGINE */
|
||||
|
||||
/* workbench engine */
|
||||
/* LayerCollection settings. */
|
||||
RNA_LAYER_ENGINE_WORKBENCH_GET_SET_FLOAT_ARRAY(object_color, 3)
|
||||
|
||||
/* eevee engine */
|
||||
/* ViewLayer settings. */
|
||||
RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_enable)
|
||||
@@ -1676,14 +1672,6 @@ static void rna_def_layer_collection_engine_settings_workbench(BlenderRNA *brna)
|
||||
RNA_def_struct_ui_text(srna, "Collections Workbench Engine Settings", "Workbench specific settings for this collection");
|
||||
|
||||
RNA_define_verify_sdna(0); /* not in sdna */
|
||||
|
||||
prop = RNA_def_property(srna, "object_color", PROP_FLOAT, PROP_COLOR);
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Workbench_object_color_get",
|
||||
"rna_LayerEngineSettings_Workbench_object_color_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Collection Color", "Color for Drawing Objects in this Collection");
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||
RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update");
|
||||
}
|
||||
|
||||
static void rna_def_layer_collection_mode_settings_object(BlenderRNA *brna)
|
||||
|
||||
@@ -189,12 +189,6 @@ const EnumPropertyItem rna_enum_viewport_lighting_items[] = {
|
||||
{0, NULL, 0, NULL, NULL}
|
||||
};
|
||||
|
||||
const EnumPropertyItem rna_enum_viewport_object_color_type_items[] = {
|
||||
{V3D_OBJECT_COLOR_COLLECTION, "COLLECTION", 0, "Collection", ""},
|
||||
{V3D_OBJECT_COLOR_OBJECT, "OBJECT", 0, "Object", ""},
|
||||
{0, NULL, 0, NULL, NULL}
|
||||
};
|
||||
|
||||
const EnumPropertyItem rna_enum_clip_editor_mode_items[] = {
|
||||
{SC_MODE_TRACKING, "TRACKING", ICON_ANIM_DATA, "Tracking", "Show tracking and solving tools"},
|
||||
{SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask", "Show mask editing tools"},
|
||||
@@ -2336,12 +2330,6 @@ static void rna_def_space_view3d(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Viewport Lighting (Solid)", "Lighting Method for Solid Viewport Shading");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_viewport_shade_update");
|
||||
|
||||
prop = RNA_def_property(srna, "viewport_object_color_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "drawtype_object_color");
|
||||
RNA_def_property_enum_items(prop, rna_enum_viewport_object_color_type_items);
|
||||
RNA_def_property_ui_text(prop, "Viewport Color", "Type of Color Distribution for Objects");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_viewport_shade_update");
|
||||
|
||||
prop = RNA_def_property(srna, "viewport_shade_texture", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "drawtype_texture");
|
||||
RNA_def_property_enum_items(prop, rna_enum_viewport_lighting_items);
|
||||
|
||||
Reference in New Issue
Block a user