diff options
Diffstat (limited to 'source')
242 files changed, 1984 insertions, 1318 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 9eb026b1c4f..e72c6c14bfb 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -152,7 +152,7 @@ typedef struct bNodeType { float width, minwidth, maxwidth; float height, minheight, maxheight; - short nclass, flag, compatibility; + short nclass, flag; /* templates for static sockets */ bNodeSocketTemplate *inputs, *outputs; @@ -251,10 +251,6 @@ typedef struct bNodeType { #define NODE_CLASS_SHADER 40 #define NODE_CLASS_LAYOUT 100 -/* nodetype->compatibility */ -#define NODE_OLD_SHADING (1 << 0) -#define NODE_NEW_SHADING (1 << 1) - /* node resize directions */ #define NODE_RESIZE_TOP 1 #define NODE_RESIZE_BOTTOM 2 @@ -600,7 +596,6 @@ void node_type_update(struct bNodeType *ntype, void node_type_exec(struct bNodeType *ntype, NodeInitExecFunction initexecfunc, NodeFreeExecFunction freeexecfunc, NodeExecFunction execfunc); void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpufunc); void node_type_internal_links(struct bNodeType *ntype, void (*update_internal_links)(struct bNodeTree *, struct bNode *)); -void node_type_compatibility(struct bNodeType *ntype, short compatibility); /** \} */ @@ -733,7 +728,7 @@ void BKE_nodetree_remove_layer_n(struct bNodeTree *ntree, struct Scene *scene, c #define SH_NODE_OUTPUT_MATERIAL 124 #define SH_NODE_OUTPUT_WORLD 125 -#define SH_NODE_OUTPUT_LAMP 126 +#define SH_NODE_OUTPUT_LIGHT 126 #define SH_NODE_FRESNEL 127 #define SH_NODE_MIX_SHADER 128 #define SH_NODE_ATTRIBUTE 129 diff --git a/source/blender/blenkernel/BKE_studiolight.h b/source/blender/blenkernel/BKE_studiolight.h index f8a9498724e..fee01fa8abb 100644 --- a/source/blender/blenkernel/BKE_studiolight.h +++ b/source/blender/blenkernel/BKE_studiolight.h @@ -103,7 +103,7 @@ enum StudioLightFlag { #define STUDIOLIGHT_FLAG_ALL (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_EXTERNAL_FILE) #define STUDIOLIGHT_FLAG_ORIENTATIONS (STUDIOLIGHT_ORIENTATION_CAMERA | STUDIOLIGHT_ORIENTATION_WORLD | STUDIOLIGHT_ORIENTATION_VIEWNORMAL) -#define STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_ORIENTATION_WORLD) +#define STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE (STUDIOLIGHT_ORIENTATION_WORLD) #define STUDIOLIGHT_ORIENTATIONS_SOLID (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_ORIENTATION_CAMERA | STUDIOLIGHT_ORIENTATION_WORLD) typedef void StudioLightFreeFunction(struct StudioLight *, void *data); diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 1d9cc9bb8d0..0c93f304218 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -473,7 +473,7 @@ static bool collection_object_add(Main *bmain, Collection *collection, Object *o { if (ob->dup_group) { /* Cyclic dependency check. */ - if (collection_find_child_recursive(collection, ob->dup_group)) { + if (collection_find_child_recursive(ob->dup_group, collection)) { return false; } } diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c index 0edeaab8900..8328d71128a 100644 --- a/source/blender/blenkernel/intern/idcode.c +++ b/source/blender/blenkernel/intern/idcode.c @@ -67,7 +67,7 @@ static IDType idtypes[] = { { ID_IM, "Image", "images", BLT_I18NCONTEXT_ID_IMAGE, IDTYPE_FLAGS_ISLINKABLE }, { ID_IP, "Ipo", "ipos", "", IDTYPE_FLAGS_ISLINKABLE }, /* deprecated */ { ID_KE, "Key", "shape_keys", BLT_I18NCONTEXT_ID_SHAPEKEY, 0 }, - { ID_LA, "Lamp", "lamps", BLT_I18NCONTEXT_ID_LAMP, IDTYPE_FLAGS_ISLINKABLE }, + { ID_LA, "Light", "lights", BLT_I18NCONTEXT_ID_LAMP, IDTYPE_FLAGS_ISLINKABLE }, { ID_LI, "Library", "libraries", BLT_I18NCONTEXT_ID_LIBRARY, 0 }, { ID_LS, "FreestyleLineStyle", "linestyles", BLT_I18NCONTEXT_ID_FREESTYLELINESTYLE, IDTYPE_FLAGS_ISLINKABLE }, { ID_LT, "Lattice", "lattices", BLT_I18NCONTEXT_ID_LATTICE, IDTYPE_FLAGS_ISLINKABLE }, diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index f8040f0cf24..b7ca73e9f4a 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1999,7 +1999,7 @@ void do_versions_ipos_to_animato(Main *bmain) for (id = bmain->lamp.first; id; id = id->next) { Lamp *la = (Lamp *)id; - if (G.debug & G_DEBUG) printf("\tconverting lamp %s\n", id->name + 2); + if (G.debug & G_DEBUG) printf("\tconverting light %s\n", id->name + 2); /* we're only interested in the IPO */ if (la->ipo) { diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index f7cd2bd52dc..7aa0ecdad87 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -3333,11 +3333,6 @@ void node_type_internal_links(bNodeType *ntype, void (*update_internal_links)(bN ntype->update_internal_links = update_internal_links; } -void node_type_compatibility(struct bNodeType *ntype, short compatibility) -{ - ntype->compatibility = compatibility; -} - /* callbacks for undefined types */ static bool node_undefined_poll(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(nodetree)) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 44c83a8d587..275e215e71a 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -648,7 +648,7 @@ static const char *get_obdata_defname(int type) case OB_FONT: return DATA_("Text"); case OB_MBALL: return DATA_("Mball"); case OB_CAMERA: return DATA_("Camera"); - case OB_LAMP: return DATA_("Lamp"); + case OB_LAMP: return DATA_("Light"); case OB_LATTICE: return DATA_("Lattice"); case OB_ARMATURE: return DATA_("Armature"); case OB_SPEAKER: return DATA_("Speaker"); diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index a382b7cca9c..ced6e967acf 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -389,7 +389,7 @@ Object *DocumentImporter::create_lamp_object(COLLADAFW::InstanceLight *lamp, Sce { const COLLADAFW::UniqueId& lamp_uid = lamp->getInstanciatedObjectId(); if (uid_lamp_map.find(lamp_uid) == uid_lamp_map.end()) { - fprintf(stderr, "Couldn't find lamp by UID.\n"); + fprintf(stderr, "Couldn't find light by UID.\n"); return NULL; } @@ -1122,7 +1122,7 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light) else lamp = (Lamp *)BKE_lamp_add(bmain, (char *)la_id.c_str()); if (!lamp) { - fprintf(stderr, "Cannot create lamp.\n"); + fprintf(stderr, "Cannot create light.\n"); return true; } @@ -1234,7 +1234,7 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light) break; case COLLADAFW::Light::UNDEFINED: { - fprintf(stderr, "Current lamp type is not supported.\n"); + fprintf(stderr, "Current light type is not supported.\n"); lamp->type = LA_LOCAL; } break; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index f64c4f5aff0..23e50f125ba 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -679,7 +679,7 @@ void DepsgraphRelationBuilder::build_object_data_lamp(Object *object) build_lamp(lamp); ComponentKey object_parameters_key(&object->id, DEG_NODE_TYPE_PARAMETERS); ComponentKey lamp_parameters_key(&lamp->id, DEG_NODE_TYPE_PARAMETERS); - add_relation(lamp_parameters_key, object_parameters_key, "Lamp -> Object"); + add_relation(lamp_parameters_key, object_parameters_key, "Light -> Object"); } void DepsgraphRelationBuilder::build_object_data_lightprobe(Object *object) @@ -1968,7 +1968,7 @@ void DepsgraphRelationBuilder::build_lamp(Lamp *lamp) build_nodetree(lamp->nodetree); ComponentKey lamp_parameters_key(&lamp->id, DEG_NODE_TYPE_PARAMETERS); ComponentKey nodetree_key(&lamp->nodetree->id, DEG_NODE_TYPE_SHADING); - add_relation(nodetree_key, lamp_parameters_key, "NTree->Lamp Parameters"); + add_relation(nodetree_key, lamp_parameters_key, "NTree->Light Parameters"); build_nested_nodetree(&lamp->id, lamp->nodetree); } } @@ -2186,7 +2186,7 @@ void DepsgraphRelationBuilder::build_nested_shapekey(ID *owner, Key *key) void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node) { ID *id_orig = id_node->id_orig; - + const ID_Type id_type = GS(id_orig->name); TimeSourceKey time_source_key; OperationKey copy_on_write_key(id_orig, DEG_NODE_TYPE_COPY_ON_WRITE, @@ -2209,9 +2209,12 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node /* Component explicitly requests to not add relation. */ continue; } - int rel_flag = 0; - if (comp_node->type == DEG_NODE_TYPE_ANIMATION) { - rel_flag |= DEPSREL_FLAG_NO_FLUSH; + int rel_flag = DEPSREL_FLAG_NO_FLUSH; + if (id_type == ID_ME && comp_node->type == DEG_NODE_TYPE_GEOMETRY) { + rel_flag &= ~DEPSREL_FLAG_NO_FLUSH; + } + if (comp_node->type == DEG_NODE_TYPE_PARAMETERS) { + rel_flag &= ~DEPSREL_FLAG_NO_FLUSH; } /* All entry operations of each component should wait for a proper * copy of ID. diff --git a/source/blender/draw/engines/eevee/eevee_bloom.c b/source/blender/draw/engines/eevee/eevee_bloom.c index 8be9c637fbc..2ec6f841409 100644 --- a/source/blender/draw/engines/eevee/eevee_bloom.c +++ b/source/blender/draw/engines/eevee/eevee_bloom.c @@ -132,9 +132,9 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) /* determine the iteration count */ const float minDim = (float)MIN2(blitsize[0], blitsize[1]); const float maxIter = (radius - 8.0f) + log(minDim) / log(2); - const int maxIterInt = effects->bloom_iteration_ct = (int)maxIter; + const int maxIterInt = effects->bloom_iteration_len = (int)maxIter; - CLAMP(effects->bloom_iteration_ct, 1, MAX_BLOOM_STEP); + CLAMP(effects->bloom_iteration_len, 1, MAX_BLOOM_STEP); effects->bloom_sample_scale = 0.5f + maxIter - (float)maxIterInt; effects->bloom_curve_threshold[0] = threshold - knee; @@ -146,7 +146,7 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) /* Downsample buffers */ copy_v2_v2_int(texsize, blitsize); - for (int i = 0; i < effects->bloom_iteration_ct; ++i) { + for (int i = 0; i < effects->bloom_iteration_len; ++i) { texsize[0] /= 2; texsize[1] /= 2; texsize[0] = MAX2(texsize[0], 2); @@ -165,7 +165,7 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) /* Upsample buffers */ copy_v2_v2_int(texsize, blitsize); - for (int i = 0; i < effects->bloom_iteration_ct - 1; ++i) { + for (int i = 0; i < effects->bloom_iteration_len - 1; ++i) { texsize[0] /= 2; texsize[1] /= 2; texsize[0] = MAX2(texsize[0], 2); @@ -291,7 +291,7 @@ void EEVEE_bloom_draw(EEVEE_Data *vedata) last = effects->bloom_downsample[0]; - for (int i = 1; i < effects->bloom_iteration_ct; ++i) { + for (int i = 1; i < effects->bloom_iteration_len; ++i) { copy_v2_v2(effects->unf_source_texel_size, effects->downsamp_texel_size[i - 1]); effects->unf_source_buffer = last; @@ -303,7 +303,7 @@ void EEVEE_bloom_draw(EEVEE_Data *vedata) } /* Upsample and accumulate */ - for (int i = effects->bloom_iteration_ct - 2; i >= 0; --i) { + for (int i = effects->bloom_iteration_len - 2; i >= 0; --i) { copy_v2_v2(effects->unf_source_texel_size, effects->downsamp_texel_size[i]); effects->unf_source_buffer = effects->bloom_downsample[i]; effects->unf_base_buffer = last; diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c index 60c6175f4fa..b9f7624552c 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c @@ -208,8 +208,8 @@ void EEVEE_depth_of_field_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_ /* This create an empty batch of N triangles to be positioned * by the vertex shader 0.4ms against 6ms with instancing */ const float *viewport_size = DRW_viewport_size_get(); - const int sprite_ct = ((int)viewport_size[0] / 2) * ((int)viewport_size[1] / 2); /* brackets matters */ - grp = DRW_shgroup_empty_tri_batch_create(e_data.dof_scatter_sh, psl->dof_scatter, sprite_ct); + const int sprite_len = ((int)viewport_size[0] / 2) * ((int)viewport_size[1] / 2); /* brackets matters */ + grp = DRW_shgroup_empty_tri_batch_create(e_data.dof_scatter_sh, psl->dof_scatter, sprite_len); DRW_shgroup_uniform_texture_ref(grp, "nearBuffer", &effects->dof_down_near); DRW_shgroup_uniform_texture_ref(grp, "farBuffer", &effects->dof_down_far); diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index 6d68e609f03..adbe165354a 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -191,10 +191,10 @@ static void eevee_draw_background(void *vedata) /* Number of iteration: needed for all temporal effect (SSR, volumetrics) * when using opengl render. */ - int loop_ct = (DRW_state_is_image_render() && + int loop_len = (DRW_state_is_image_render() && (stl->effects->enabled_effects & (EFFECT_VOLUMETRIC | EFFECT_SSR)) != 0) ? 4 : 1; - while (loop_ct--) { + while (loop_len--) { float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f}; float clear_depth = 1.0f; uint clear_stencil = 0xFF; diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index 54bf59234b3..1cb9a957211 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -364,8 +364,8 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRWShadingGroup *grp = DRW_shgroup_create(e_data.probe_filter_glossy_sh, psl->probe_glossy_compute); DRW_shgroup_uniform_float(grp, "intensityFac", &pinfo->intensity_fac, 1); - DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_ct, 1); - DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->invsamples_ct, 1); + DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_len, 1); + DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->samples_len_inv, 1); DRW_shgroup_uniform_float(grp, "roughnessSquared", &pinfo->roughness, 1); DRW_shgroup_uniform_float(grp, "lodFactor", &pinfo->lodfactor, 1); DRW_shgroup_uniform_float(grp, "lodMax", &pinfo->lod_rt_max, 1); @@ -385,8 +385,8 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, #ifdef IRRADIANCE_SH_L2 DRW_shgroup_uniform_int(grp, "probeSize", &pinfo->shres, 1); #else - DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_ct, 1); - DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->invsamples_ct, 1); + DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_len, 1); + DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->samples_len_inv, 1); DRW_shgroup_uniform_float(grp, "lodFactor", &pinfo->lodfactor, 1); DRW_shgroup_uniform_float(grp, "lodMax", &pinfo->lod_rt_max, 1); DRW_shgroup_uniform_texture(grp, "texHammersley", e_data.hammersley); @@ -405,8 +405,8 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRW_shgroup_uniform_int(grp, "outputSize", &pinfo->shres, 1); DRW_shgroup_uniform_float(grp, "visibilityRange", &pinfo->visibility_range, 1); DRW_shgroup_uniform_float(grp, "visibilityBlur", &pinfo->visibility_blur, 1); - DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_ct, 1); - DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->invsamples_ct, 1); + DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_len, 1); + DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->samples_len_inv, 1); DRW_shgroup_uniform_float(grp, "storedTexelSize", &pinfo->texel_size, 1); DRW_shgroup_uniform_float(grp, "nearClip", &pinfo->near_clip, 1); DRW_shgroup_uniform_float(grp, "farClip", &pinfo->far_clip, 1); @@ -1111,18 +1111,18 @@ void EEVEE_lightbake_filter_glossy( #if 1 /* Variable Sample count (fast) */ switch (i) { - case 0: pinfo->samples_ct = 1.0f; break; - case 1: pinfo->samples_ct = 16.0f; break; - case 2: pinfo->samples_ct = 32.0f; break; - case 3: pinfo->samples_ct = 64.0f; break; - default: pinfo->samples_ct = 128.0f; break; + case 0: pinfo->samples_len = 1.0f; break; + case 1: pinfo->samples_len = 16.0f; break; + case 2: pinfo->samples_len = 32.0f; break; + case 3: pinfo->samples_len = 64.0f; break; + default: pinfo->samples_len = 128.0f; break; } #else /* Constant Sample count (slow) */ - pinfo->samples_ct = 1024.0f; + pinfo->samples_len = 1024.0f; #endif - pinfo->invsamples_ct = 1.0f / pinfo->samples_ct; - pinfo->lodfactor = bias + 0.5f * log((float)(target_size * target_size) * pinfo->invsamples_ct) / log(2); + pinfo->samples_len_inv = 1.0f / pinfo->samples_len; + pinfo->lodfactor = bias + 0.5f * log((float)(target_size * target_size) * pinfo->samples_len_inv) / log(2); GPU_framebuffer_ensure_config(&fb, { GPU_ATTACHMENT_NONE, @@ -1157,10 +1157,10 @@ void EEVEE_lightbake_filter_diffuse( int size[2] = {3, 3}; #elif defined(IRRADIANCE_CUBEMAP) int size[2] = {8, 8}; - pinfo->samples_ct = 1024.0f; + pinfo->samples_len = 1024.0f; #elif defined(IRRADIANCE_HL2) int size[2] = {3, 2}; - pinfo->samples_ct = 1024.0f; + pinfo->samples_len = 1024.0f; #endif int cell_per_row = GPU_texture_width(light_cache->grid_tx.tex) / size[0]; @@ -1170,8 +1170,8 @@ void EEVEE_lightbake_filter_diffuse( #ifndef IRRADIANCE_SH_L2 /* Tweaking parameters to balance perf. vs precision */ const float bias = 0.0f; - pinfo->invsamples_ct = 1.0f / pinfo->samples_ct; - pinfo->lodfactor = bias + 0.5f * log((float)(target_size * target_size) * pinfo->invsamples_ct) / log(2); + pinfo->samples_len_inv = 1.0f / pinfo->samples_len; + pinfo->lodfactor = bias + 0.5f * log((float)(target_size * target_size) * pinfo->samples_len_inv) / log(2); pinfo->lod_rt_max = floorf(log2f(target_size)) - 2.0f; #else pinfo->shres = 32; /* Less texture fetches & reduce branches */ @@ -1207,8 +1207,8 @@ void EEVEE_lightbake_filter_visibility( EEVEE_LightProbesInfo *pinfo = sldata->probes; LightCache *light_cache = vedata->stl->g_data->light_cache; - pinfo->samples_ct = 512.0f; /* TODO refine */ - pinfo->invsamples_ct = 1.0f / pinfo->samples_ct; + pinfo->samples_len = 512.0f; /* TODO refine */ + pinfo->samples_len_inv = 1.0f / pinfo->samples_len; pinfo->shres = vis_size; pinfo->visibility_range = vis_range; pinfo->visibility_blur = vis_blur; diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index 1e11f224231..0f0d9d281c9 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -235,9 +235,9 @@ static GPUShader *eevee_lights_get_store_sh(int shadow_method, bool high_blur, b return *shader; } -static DRWPass *eevee_lights_cube_store_pass_get(EEVEE_PassList *psl, EEVEE_ViewLayerData *sldata, int shadow_method, int shadow_samples_ct) +static DRWPass *eevee_lights_cube_store_pass_get(EEVEE_PassList *psl, EEVEE_ViewLayerData *sldata, int shadow_method, int shadow_samples_len) { - bool high_blur = shadow_samples_ct > 16; + bool high_blur = shadow_samples_len > 16; DRWPass **pass = (high_blur) ? &psl->shadow_cube_store_pass : &psl->shadow_cube_store_high_pass; if (*pass == NULL) { EEVEE_LampsInfo *linfo = sldata->lamps; @@ -252,9 +252,9 @@ static DRWPass *eevee_lights_cube_store_pass_get(EEVEE_PassList *psl, EEVEE_View return *pass; } -static DRWPass *eevee_lights_cascade_store_pass_get(EEVEE_PassList *psl, EEVEE_ViewLayerData *sldata, int shadow_method, int shadow_samples_ct) +static DRWPass *eevee_lights_cascade_store_pass_get(EEVEE_PassList *psl, EEVEE_ViewLayerData *sldata, int shadow_method, int shadow_samples_len) { - bool high_blur = shadow_samples_ct > 16; + bool high_blur = shadow_samples_len > 16; DRWPass **pass = (high_blur) ? &psl->shadow_cascade_store_pass : &psl->shadow_cascade_store_high_pass; if (*pass == NULL) { EEVEE_LampsInfo *linfo = sldata->lamps; @@ -280,8 +280,8 @@ void EEVEE_lights_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) linfo->num_light = 0; linfo->num_cube_layer = 0; linfo->num_cascade_layer = 0; - linfo->gpu_cube_ct = linfo->gpu_cascade_ct = linfo->gpu_shadow_ct = 0; - linfo->cpu_cube_ct = linfo->cpu_cascade_ct = 0; + linfo->gpu_cube_len = linfo->gpu_cascade_len = linfo->gpu_shadow_len = 0; + linfo->cpu_cube_len = linfo->cpu_cascade_len = 0; memset(linfo->light_ref, 0, sizeof(linfo->light_ref)); memset(linfo->shadow_cube_ref, 0, sizeof(linfo->shadow_cube_ref)); memset(linfo->shadow_cascade_ref, 0, sizeof(linfo->shadow_cascade_ref)); @@ -334,7 +334,7 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob) /* Step 1 find all lamps in the scene and setup them */ if (linfo->num_light >= MAX_LIGHT) { - printf("Too many lamps in the scene !!!\n"); + printf("Too many lights in the scene !!!\n"); } else { Lamp *la = (Lamp *)ob->data; @@ -361,56 +361,56 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob) int sh_nbr = 1; /* TODO : MSM */ int cascade_nbr = la->cascade_count; - if ((linfo->gpu_cascade_ct + sh_nbr) <= MAX_SHADOW_CASCADE) { + if ((linfo->gpu_cascade_len + sh_nbr) <= MAX_SHADOW_CASCADE) { /* Save Light object. */ - linfo->shadow_cascade_ref[linfo->cpu_cascade_ct] = ob; + linfo->shadow_cascade_ref[linfo->cpu_cascade_len] = ob; /* Store indices. */ EEVEE_ShadowCascadeData *data = &led->data.scad; - data->shadow_id = linfo->gpu_shadow_ct; - data->cascade_id = linfo->gpu_cascade_ct; + data->shadow_id = linfo->gpu_shadow_len; + data->cascade_id = linfo->gpu_cascade_len; data->layer_id = linfo->num_cascade_layer; /* Increment indices. */ - linfo->gpu_shadow_ct += 1; - linfo->gpu_cascade_ct += sh_nbr; + linfo->gpu_shadow_len += 1; + linfo->gpu_cascade_len += sh_nbr; linfo->num_cascade_layer += sh_nbr * cascade_nbr; - linfo->cpu_cascade_ct += 1; + linfo->cpu_cascade_len += 1; } } else if (la->type == LA_SPOT || la->type == LA_LOCAL || la->type == LA_AREA) { int sh_nbr = 1; /* TODO : MSM */ - if ((linfo->gpu_cube_ct + sh_nbr) <= MAX_SHADOW_CUBE) { + if ((linfo->gpu_cube_len + sh_nbr) <= MAX_SHADOW_CUBE) { /* Save Light object. */ - linfo->shadow_cube_ref[linfo->cpu_cube_ct] = ob; + linfo->shadow_cube_ref[linfo->cpu_cube_len] = ob; /* For light update tracking. */ if ((prev_cube_sh_id >= 0) && (prev_cube_sh_id < linfo->shcaster_backbuffer->count)) { - linfo->new_shadow_id[prev_cube_sh_id] = linfo->cpu_cube_ct; + linfo->new_shadow_id[prev_cube_sh_id] = linfo->cpu_cube_len; } - led->prev_cube_shadow_id = linfo->cpu_cube_ct; + led->prev_cube_shadow_id = linfo->cpu_cube_len; /* Saving lamp bounds for later. */ - BLI_assert(linfo->cpu_cube_ct >= 0 && linfo->cpu_cube_ct < MAX_LIGHT); - copy_v3_v3(linfo->shadow_bounds[linfo->cpu_cube_ct].center, ob->obmat[3]); - linfo->shadow_bounds[linfo->cpu_cube_ct].radius = la->clipend; + BLI_assert(linfo->cpu_cube_len >= 0 && linfo->cpu_cube_len < MAX_LIGHT); + copy_v3_v3(linfo->shadow_bounds[linfo->cpu_cube_len].center, ob->obmat[3]); + linfo->shadow_bounds[linfo->cpu_cube_len].radius = la->clipend; EEVEE_ShadowCubeData *data = &led->data.scd; /* Store indices. */ - data->shadow_id = linfo->gpu_shadow_ct; - data->cube_id = linfo->gpu_cube_ct; + data->shadow_id = linfo->gpu_shadow_len; + data->cube_id = linfo->gpu_cube_len; data->layer_id = linfo->num_cube_layer; /* Increment indices. */ - linfo->gpu_shadow_ct += 1; - linfo->gpu_cube_ct += sh_nbr; + linfo->gpu_shadow_len += 1; + linfo->gpu_cube_len += sh_nbr; linfo->num_cube_layer += sh_nbr; - linfo->cpu_cube_ct += 1; + linfo->cpu_cube_len += 1; } } } @@ -993,7 +993,7 @@ void EEVEE_lights_update(EEVEE_ViewLayerData *sldata) for (i = 0; i < frontbuffer->count; i++, flag++, shcaster++) { /* Run intersection checks to fill the bitfields. */ bsphere = linfo->shadow_bounds; - for (int j = 0; j < linfo->cpu_cube_ct; j++, bsphere++) { + for (int j = 0; j < linfo->cpu_cube_len; j++, bsphere++) { bool iter = sphere_bbox_intersect(bsphere, &shcaster->bbox); lightbits_set_single(&shcaster->bits, j, iter); } @@ -1139,19 +1139,19 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_PassList *psl) filter_pixel_size = max_ff(0.0f, filter_pixel_size - 3.0f); /* Compute number of concentric samples. Depends directly on filter size. */ float pix_size_sqr = filter_pixel_size * filter_pixel_size; - srd->shadow_samples_ct = min_ii(max_sample, 4 + 8 * (int)filter_pixel_size + 4 * (int)(pix_size_sqr)); + srd->shadow_samples_len = min_ii(max_sample, 4 + 8 * (int)filter_pixel_size + 4 * (int)(pix_size_sqr)); } else { linfo->filter_size = 0.0f; - srd->shadow_samples_ct = 4; + srd->shadow_samples_len = 4; } - srd->shadow_inv_samples_ct = 1.0f / (float)srd->shadow_samples_ct; + srd->shadow_samples_len_inv = 1.0f / (float)srd->shadow_samples_len; DRW_uniformbuffer_update(sldata->shadow_render_ubo, srd); GPU_framebuffer_texture_layer_attach(sldata->shadow_cube_store_fb, sldata->shadow_cube_pool, 0, evscd->layer_id, 0); GPU_framebuffer_bind(sldata->shadow_cube_store_fb); - DRWPass *store_pass = eevee_lights_cube_store_pass_get(psl, sldata, linfo->shadow_method, srd->shadow_samples_ct); + DRWPass *store_pass = eevee_lights_cube_store_pass_get(psl, sldata, linfo->shadow_method, srd->shadow_samples_len); DRW_draw_pass(store_pass); led->need_update = false; @@ -1240,20 +1240,20 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_PassList *psl) filter_pixel_size = max_ff(0.0f, filter_pixel_size - 3.0f); /* Compute number of concentric samples. Depends directly on filter size. */ float pix_size_sqr = filter_pixel_size * filter_pixel_size; - srd->shadow_samples_ct = min_ii(max_sample, 4 + 8 * (int)filter_pixel_size + 4 * (int)(pix_size_sqr)); + srd->shadow_samples_len = min_ii(max_sample, 4 + 8 * (int)filter_pixel_size + 4 * (int)(pix_size_sqr)); } else { linfo->filter_size = 0.0f; - srd->shadow_samples_ct = 4; + srd->shadow_samples_len = 4; } - srd->shadow_inv_samples_ct = 1.0f / (float)srd->shadow_samples_ct; + srd->shadow_samples_len_inv = 1.0f / (float)srd->shadow_samples_len; DRW_uniformbuffer_update(sldata->shadow_render_ubo, &linfo->shadow_render_data); int layer = evscd->layer_id + linfo->current_shadow_cascade; GPU_framebuffer_texture_layer_attach(sldata->shadow_cascade_store_fb, sldata->shadow_cascade_pool, 0, layer, 0); GPU_framebuffer_bind(sldata->shadow_cascade_store_fb); - DRWPass *store_pass = eevee_lights_cascade_store_pass_get(psl, sldata, linfo->shadow_method, srd->shadow_samples_ct); + DRWPass *store_pass = eevee_lights_cascade_store_pass_get(psl, sldata, linfo->shadow_method, srd->shadow_samples_len); DRW_draw_pass(store_pass); } } diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.c b/source/blender/draw/engines/eevee/eevee_lookdev.c index 4c403b93f3e..2e568d97c07 100644 --- a/source/blender/draw/engines/eevee/eevee_lookdev.c +++ b/source/blender/draw/engines/eevee/eevee_lookdev.c @@ -57,9 +57,9 @@ void EEVEE_lookdev_cache_init( EEVEE_TextureList *txl = vedata->txl; const DRWContextState *draw_ctx = DRW_context_state_get(); View3D *v3d = draw_ctx->v3d; - if (LOOK_DEV_MODE_ENABLED(v3d)) { - StudioLight *sl = BKE_studiolight_find(v3d->shading.studio_light, STUDIOLIGHT_INTERNAL | STUDIOLIGHT_ORIENTATION_WORLD); - if ((sl->flag & STUDIOLIGHT_ORIENTATION_WORLD)) { + if (LOOK_DEV_STUDIO_LIGHT_ENABLED(v3d)) { + StudioLight *sl = BKE_studiolight_find(v3d->shading.studio_light, STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE); + if (sl && (sl->flag & STUDIOLIGHT_ORIENTATION_WORLD)) { struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get(); GPUTexture *tex = NULL; diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index fba377cbcaf..20d755d2245 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -115,8 +115,8 @@ static struct GPUTexture *create_ggx_lut_texture(int UNUSED(w), int UNUSED(h)) { struct GPUTexture *tex; struct GPUFrameBuffer *fb = NULL; - static float samples_ct = 8192.0f; - static float inv_samples_ct = 1.0f / 8192.0f; + static float samples_len = 8192.0f; + static float inv_samples_len = 1.0f / 8192.0f; char *lib_str = BLI_string_joinN( datatoc_bsdf_common_lib_glsl, @@ -130,8 +130,8 @@ static struct GPUTexture *create_ggx_lut_texture(int UNUSED(w), int UNUSED(h)) DRWPass *pass = DRW_pass_create("LightProbe Filtering", DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(sh, pass); - DRW_shgroup_uniform_float(grp, "sampleCount", &samples_ct, 1); - DRW_shgroup_uniform_float(grp, "invSampleCount", &inv_samples_ct, 1); + DRW_shgroup_uniform_float(grp, "sampleCount", &samples_len, 1); + DRW_shgroup_uniform_float(grp, "invSampleCount", &inv_samples_len, 1); DRW_shgroup_uniform_texture(grp, "texHammersley", e_data.hammersley); DRW_shgroup_uniform_texture(grp, "texJitter", e_data.jitter); @@ -172,9 +172,9 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h) struct GPUTexture *tex; struct GPUTexture *hammersley = create_hammersley_sample_texture(8192); struct GPUFrameBuffer *fb = NULL; - static float samples_ct = 8192.0f; + static float samples_len = 8192.0f; static float a2 = 0.0f; - static float inv_samples_ct = 1.0f / 8192.0f; + static float inv_samples_len = 1.0f / 8192.0f; char *frag_str = BLI_string_joinN( datatoc_bsdf_common_lib_glsl, @@ -192,8 +192,8 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h) DRWPass *pass = DRW_pass_create("LightProbe Filtering", DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(sh, pass); DRW_shgroup_uniform_float(grp, "a2", &a2, 1); - DRW_shgroup_uniform_float(grp, "sampleCount", &samples_ct, 1); - DRW_shgroup_uniform_float(grp, "invSampleCount", &inv_samples_ct, 1); + DRW_shgroup_uniform_float(grp, "sampleCount", &samples_len, 1); + DRW_shgroup_uniform_float(grp, "invSampleCount", &inv_samples_len, 1); DRW_shgroup_uniform_texture(grp, "texHammersley", hammersley); DRW_shgroup_uniform_texture(grp, "utilTex", e_data.util_tex); diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index c9149d3bcf8..e2a875dca1f 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -98,7 +98,8 @@ extern struct DrawEngineType draw_engine_eevee_type; #define OVERLAY_ENABLED(v3d) ((v3d) && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) #define LOOK_DEV_MODE_ENABLED(v3d) ((v3d) && (v3d->drawtype == OB_MATERIAL)) #define LOOK_DEV_OVERLAY_ENABLED(v3d) (LOOK_DEV_MODE_ENABLED(v3d) && OVERLAY_ENABLED(v3d) && (v3d->overlay.flag & V3D_OVERLAY_LOOK_DEV)) -#define USE_SCENE_LIGHT(v3d) ((!v3d) || (!LOOK_DEV_MODE_ENABLED(v3d)) || ((LOOK_DEV_MODE_ENABLED(v3d) && (v3d->shading.flag & V3D_SHADING_SCENE_LIGHT)))) +#define USE_SCENE_LIGHT(v3d) ((!v3d) || (!LOOK_DEV_MODE_ENABLED(v3d)) || ((LOOK_DEV_MODE_ENABLED(v3d) && (v3d->shading.flag & V3D_SHADING_SCENE_LIGHTS)))) +#define LOOK_DEV_STUDIO_LIGHT_ENABLED(v3d) (LOOK_DEV_MODE_ENABLED(v3d) && !(v3d->shading.flag & V3D_SHADING_SCENE_WORLD)) #define OCTAHEDRAL_SIZE_FROM_CUBESIZE(cube_size) ((int)ceilf(sqrtf((cube_size * cube_size) * 6.0f))) #define MIN_CUBE_LOD_LEVEL 3 @@ -359,14 +360,14 @@ typedef struct EEVEE_ShadowRender { float stored_texel_size; float clip_near; float clip_far; - int shadow_samples_ct; - float shadow_inv_samples_ct; + int shadow_samples_len; + float shadow_samples_len_inv; } EEVEE_ShadowRender; /* This is just a really long bitflag with special function to access it. */ #define MAX_LIGHTBITS_FIELDS (MAX_LIGHT / 8) typedef struct EEVEE_LightBits { - unsigned char fields[MAX_LIGHTBITS_FIELDS]; + uchar fields[MAX_LIGHTBITS_FIELDS]; } EEVEE_LightBits; typedef struct EEVEE_ShadowCaster { @@ -386,8 +387,8 @@ typedef struct EEVEE_LampsInfo { int num_light, cache_num_light; int num_cube_layer, cache_num_cube_layer; int num_cascade_layer, cache_num_cascade_layer; - int gpu_cube_ct, gpu_cascade_ct, gpu_shadow_ct; - int cpu_cube_ct, cpu_cascade_ct; + int gpu_cube_len, gpu_cascade_len, gpu_shadow_len; + int cpu_cube_len, cpu_cascade_len; int update_flag; int shadow_cube_size, shadow_cascade_size, shadow_method; bool shadow_high_bitdepth; @@ -451,8 +452,8 @@ typedef struct EEVEE_LightProbesInfo { int layer; float texel_size; float padding_size; - float samples_ct; - float invsamples_ct; + float samples_len; + float samples_len_inv; float near_clip; float far_clip; float roughness; @@ -558,7 +559,7 @@ typedef struct EEVEE_EffectsInfo { /* Other */ float prev_persmat[4][4]; /* Bloom */ - int bloom_iteration_ct; + int bloom_iteration_len; float source_texel_size[2]; float blit_texel_size[2]; float downsamp_texel_size[MAX_BLOOM_STEP][2]; diff --git a/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl b/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl index 948392bd8ee..d8c8f22ed1c 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl @@ -6,24 +6,24 @@ #ifdef DOUBLE_MANIFOLD # ifdef USE_INVOC_EXT -# define invoc_ct 2 +# define invoc_len 2 # else -# define vert_ct 6 +# define vert_len 6 # endif #else # ifdef USE_INVOC_EXT -# define invoc_ct 2 +# define invoc_len 2 # else -# define vert_ct 6 +# define vert_len 6 # endif #endif #ifdef USE_INVOC_EXT -layout(triangles, invocations = invoc_ct) in; +layout(triangles, invocations = invoc_len) in; layout(triangle_strip, max_vertices = 3) out; #else layout(triangles) in; -layout(triangle_strip, max_vertices = vert_ct) out; +layout(triangle_strip, max_vertices = vert_len) out; #endif uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); diff --git a/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl b/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl index 5a31aa34932..7418f86a58e 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl @@ -6,24 +6,24 @@ #ifdef DOUBLE_MANIFOLD # ifdef USE_INVOC_EXT -# define invoc_ct 2 +# define invoc_len 2 # else -# define vert_ct 8 +# define vert_len 8 # endif #else # ifdef USE_INVOC_EXT -# define invoc_ct 1 +# define invoc_len 1 # else -# define vert_ct 4 +# define vert_len 4 # endif #endif #ifdef USE_INVOC_EXT -layout(lines_adjacency, invocations = invoc_ct) in; +layout(lines_adjacency, invocations = invoc_len) in; layout(triangle_strip, max_vertices = 4) out; #else layout(lines_adjacency) in; -layout(triangle_strip, max_vertices = vert_ct) out; +layout(triangle_strip, max_vertices = vert_len) out; #endif uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index f420a4a24b3..4d1b8269494 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -347,9 +347,9 @@ void DRW_shgroup_free(struct DRWShadingGroup *shgroup); void DRW_shgroup_call_add(DRWShadingGroup *shgroup, struct Gwn_Batch *geom, float (*obmat)[4]); void DRW_shgroup_call_range_add( DRWShadingGroup *shgroup, struct Gwn_Batch *geom, float (*obmat)[4], uint v_sta, uint v_count); -void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, unsigned int point_count, float (*obmat)[4]); -void DRW_shgroup_call_procedural_lines_add(DRWShadingGroup *shgroup, unsigned int line_count, float (*obmat)[4]); -void DRW_shgroup_call_procedural_triangles_add(DRWShadingGroup *shgroup, unsigned int tria_count, float (*obmat)[4]); +void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, uint point_len, float (*obmat)[4]); +void DRW_shgroup_call_procedural_lines_add(DRWShadingGroup *shgroup, uint line_count, float (*obmat)[4]); +void DRW_shgroup_call_procedural_triangles_add(DRWShadingGroup *shgroup, uint tria_count, float (*obmat)[4]); void DRW_shgroup_call_object_procedural_triangles_culled_add(DRWShadingGroup *shgroup, uint tria_count, struct Object *ob); void DRW_shgroup_call_object_add_ex(DRWShadingGroup *shgroup, struct Gwn_Batch *geom, struct Object *ob, bool bypass_culling); #define DRW_shgroup_call_object_add(shgroup, geom, ob) DRW_shgroup_call_object_add_ex(shgroup, geom, ob, false) @@ -513,7 +513,7 @@ void DRW_state_lock(DRWState state); void DRW_state_invert_facing(void); -void DRW_state_clip_planes_count_set(uint plane_ct); +void DRW_state_clip_planes_count_set(uint plane_len); void DRW_state_clip_planes_reset(void); /* Culling, return true if object is inside view frustum. */ diff --git a/source/blender/draw/intern/draw_anim_viz.c b/source/blender/draw/intern/draw_anim_viz.c index 42c36ab3662..e634710980a 100644 --- a/source/blender/draw/intern/draw_anim_viz.c +++ b/source/blender/draw/intern/draw_anim_viz.c @@ -149,12 +149,12 @@ static void MPATH_cache_init(void *vedata) MPATH_PassList *psl = ((MPATH_Data *)vedata)->psl; { - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS; + DRWState state = DRW_STATE_WRITE_COLOR; psl->lines = DRW_pass_create("Motionpath Line Pass", state); } { - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_POINT; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_POINT; psl->points = DRW_pass_create("Motionpath Point Pass", state); } } @@ -256,7 +256,7 @@ static void MPATH_cache_motion_path(MPATH_PassList *psl, bool show_kf_no = (avs->path_viewflag & MOTIONPATH_VIEW_KFNOS) != 0; if ((avs->path_viewflag & (MOTIONPATH_VIEW_FNUMS)) || (show_kf_no && show_keyframes)) { int i; - unsigned char col[4], col_kf[4]; + uchar col[4], col_kf[4]; UI_GetThemeColor3ubv(TH_TEXT_HI, col); UI_GetThemeColor3ubv(TH_VERTEX_SELECT, col_kf); col[3] = col_kf[3] = 255; diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c index 3faf8a352b2..9bc8b70b67c 100644 --- a/source/blender/draw/intern/draw_armature.c +++ b/source/blender/draw/intern/draw_armature.c @@ -514,7 +514,7 @@ static void set_pchan_colorset(Object *ob, bPoseChannel *pchan) } /* This function is for brightening/darkening a given color (like UI_GetThemeColorShade3ubv()) */ -static void cp_shade_color3ub(unsigned char cp[3], const int offset) +static void cp_shade_color3ub(uchar cp[3], const int offset) { int r, g, b; @@ -549,7 +549,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const case PCHAN_COLOR_NORMAL: { if (bcolor) { - unsigned char cp[4] = {255}; + uchar cp[4] = {255}; if (boneflag & BONE_DRAW_ACTIVE) { copy_v3_v3_char((char *)cp, bcolor->active); @@ -591,7 +591,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const if (bcolor) { float solid_bcolor[3]; - rgb_uchar_to_float(solid_bcolor, (unsigned char *)bcolor->solid); + rgb_uchar_to_float(solid_bcolor, (uchar *)bcolor->solid); interp_v3_v3v3(fcolor, fcolor, solid_bcolor, 1.0f); } @@ -600,7 +600,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const case PCHAN_COLOR_CONSTS: { if ((bcolor == NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS)) { - unsigned char cp[4]; + uchar cp[4]; if (constflag & PCHAN_HAS_TARGET) rgba_char_args_set((char *)cp, 255, 150, 0, 80); else if (constflag & PCHAN_HAS_IK) rgba_char_args_set((char *)cp, 255, 255, 0, 80); else if (constflag & PCHAN_HAS_SPLINEIK) rgba_char_args_set((char *)cp, 200, 255, 0, 80); @@ -618,7 +618,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const case PCHAN_COLOR_SPHEREBONE_BASE: { if (bcolor) { - unsigned char cp[4] = {255}; + uchar cp[4] = {255}; if (boneflag & BONE_DRAW_ACTIVE) { copy_v3_v3_char((char *)cp, bcolor->active); @@ -649,7 +649,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const case PCHAN_COLOR_SPHEREBONE_END: { if (bcolor) { - unsigned char cp[4] = {255}; + uchar cp[4] = {255}; if (boneflag & BONE_DRAW_ACTIVE) { copy_v3_v3_char((char *)cp, bcolor->active); @@ -683,7 +683,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const { /* inner part in background color or constraint */ if ((constflag) && ((bcolor == NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS))) { - unsigned char cp[4]; + uchar cp[4]; if (constflag & PCHAN_HAS_TARGET) rgba_char_args_set((char *)cp, 255, 150, 0, 255); else if (constflag & PCHAN_HAS_IK) rgba_char_args_set((char *)cp, 255, 255, 0, 255); else if (constflag & PCHAN_HAS_SPLINEIK) rgba_char_args_set((char *)cp, 200, 255, 0, 255); @@ -695,7 +695,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const else { if (bcolor) { const char *cp = bcolor->solid; - rgb_uchar_to_float(fcolor, (unsigned char *)cp); + rgb_uchar_to_float(fcolor, (uchar *)cp); fcolor[3] = 204.f / 255.f; } else { @@ -1588,7 +1588,7 @@ static void draw_armature_edit(Object *ob) /* Draw names of bone */ if (show_text && (arm->flag & ARM_DRAWNAMES)) { - unsigned char color[4]; + uchar color[4]; UI_GetThemeColor4ubv((eBone->flag & BONE_SELECTED) ? TH_TEXT_HI : TH_TEXT, color); float vec[3]; @@ -1702,7 +1702,7 @@ static void draw_armature_pose(Object *ob, const float const_color[4]) /* Draw names of bone */ if (show_text && (arm->flag & ARM_DRAWNAMES)) { - unsigned char color[4]; + uchar color[4]; UI_GetThemeColor4ubv((arm->flag & ARM_POSEMODE) && (bone->flag & BONE_SELECTED) ? TH_TEXT_HI : TH_TEXT, color); float vec[3]; diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index a8d2c2a3642..2251285be74 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -164,7 +164,7 @@ static Gwn_VertBuf *fill_arrows_vbo(const float scale) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -211,7 +211,7 @@ static Gwn_VertBuf *sphere_wire_vbo(const float rad) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -263,7 +263,7 @@ Gwn_Batch *DRW_cache_fullscreen_quad_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos, uvs; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.uvs = GWN_vertformat_attr_add(&format, "uvs", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -291,7 +291,7 @@ Gwn_Batch *DRW_cache_quad_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos, uvs; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.uvs = GWN_vertformat_attr_add(&format, "uvs", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -344,7 +344,7 @@ Gwn_Batch *DRW_cache_cube_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -369,7 +369,7 @@ Gwn_Batch *DRW_cache_circle_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -400,7 +400,7 @@ Gwn_Batch *DRW_cache_square_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -427,7 +427,7 @@ Gwn_Batch *DRW_cache_single_line_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -452,7 +452,7 @@ Gwn_Batch *DRW_cache_single_line_endpoints_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -476,7 +476,7 @@ Gwn_Batch *DRW_cache_screenspace_circle_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -613,7 +613,7 @@ Gwn_Batch *DRW_cache_plain_axes_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -644,7 +644,7 @@ Gwn_Batch *DRW_cache_single_arrow_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -700,7 +700,7 @@ Gwn_Batch *DRW_cache_empty_cone_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -752,7 +752,7 @@ Gwn_Batch *DRW_cache_axis_names_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* Using 3rd component as axis indicator */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -810,7 +810,7 @@ Gwn_Batch *DRW_cache_image_plane_get(void) const float quad[4][2] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}}; static Gwn_VertFormat format = { 0 }; static struct { uint pos, texCoords; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.texCoords = GWN_vertformat_attr_add(&format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -831,7 +831,7 @@ Gwn_Batch *DRW_cache_image_plane_wire_get(void) const float quad[4][2] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}}; static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format); @@ -854,7 +854,7 @@ Gwn_Batch *DRW_cache_field_wind_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -891,7 +891,7 @@ Gwn_Batch *DRW_cache_field_force_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -929,7 +929,7 @@ Gwn_Batch *DRW_cache_field_vortex_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -966,7 +966,7 @@ Gwn_Batch *DRW_cache_field_tube_limit_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1015,7 +1015,7 @@ Gwn_Batch *DRW_cache_field_cone_limit_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1070,7 +1070,7 @@ Gwn_Batch *DRW_cache_lamp_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -1102,7 +1102,7 @@ Gwn_Batch *DRW_cache_lamp_shadows_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -1133,7 +1133,7 @@ Gwn_Batch *DRW_cache_lamp_sunrays_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -1168,7 +1168,7 @@ Gwn_Batch *DRW_cache_lamp_area_square_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1201,7 +1201,7 @@ Gwn_Batch *DRW_cache_lamp_area_disk_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1235,7 +1235,7 @@ Gwn_Batch *DRW_cache_lamp_hemi_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1313,7 +1313,7 @@ Gwn_Batch *DRW_cache_lamp_spot_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos, n1, n2; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.n1 = GWN_vertformat_attr_add(&format, "N1", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.n2 = GWN_vertformat_attr_add(&format, "N2", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); @@ -1372,7 +1372,7 @@ Gwn_Batch *DRW_cache_lamp_spot_square_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1410,7 +1410,7 @@ Gwn_Batch *DRW_cache_speaker_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1483,7 +1483,7 @@ Gwn_Batch *DRW_cache_lightprobe_cube_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1528,7 +1528,7 @@ Gwn_Batch *DRW_cache_lightprobe_grid_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1581,7 +1581,7 @@ Gwn_Batch *DRW_cache_lightprobe_planar_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1709,7 +1709,7 @@ Gwn_Batch *DRW_cache_bone_octahedral_get(void) static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor, snor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.snor = GWN_vertformat_attr_add(&format, "snor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); @@ -1875,7 +1875,7 @@ Gwn_Batch *DRW_cache_bone_box_get(void) static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor, snor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.snor = GWN_vertformat_attr_add(&format, "snor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); @@ -1942,7 +1942,7 @@ Gwn_Batch *DRW_cache_bone_envelope_solid_get(void) static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1989,7 +1989,7 @@ Gwn_Batch *DRW_cache_bone_envelope_outline_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos0, pos1, pos2; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos0 = GWN_vertformat_attr_add(&format, "pos0", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.pos1 = GWN_vertformat_attr_add(&format, "pos1", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.pos2 = GWN_vertformat_attr_add(&format, "pos2", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); @@ -2045,7 +2045,7 @@ Gwn_Batch *DRW_cache_bone_point_get(void) static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -2081,7 +2081,7 @@ Gwn_Batch *DRW_cache_bone_point_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -2115,7 +2115,7 @@ Gwn_Batch *DRW_cache_bone_point_wire_outline_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos0, pos1; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos0 = GWN_vertformat_attr_add(&format, "pos0", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.pos1 = GWN_vertformat_attr_add(&format, "pos1", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -2172,7 +2172,7 @@ Gwn_Batch *DRW_cache_bone_stick_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos, flag; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.flag = GWN_vertformat_attr_add(&format, "flag", GWN_COMP_U32, 1, GWN_FETCH_INT); } @@ -2314,7 +2314,7 @@ Gwn_Batch *DRW_cache_bone_arrows_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint axis, pos, col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.axis = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); attr_id.pos = GWN_vertformat_attr_add(&format, "screenPos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.col = GWN_vertformat_attr_add(&format, "colorAxis", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); @@ -2349,26 +2349,26 @@ Gwn_Batch *DRW_cache_bone_arrows_get(void) a = axis + 0.31f; /* Axis name */ - int axis_v_ct; + int axis_v_len; float (*axis_verts)[2]; if (axis == 0) { axis_verts = x_axis_name; - axis_v_ct = X_LEN; + axis_v_len = X_LEN; } else if (axis == 1) { axis_verts = y_axis_name; - axis_v_ct = Y_LEN; + axis_v_len = Y_LEN; } else { axis_verts = z_axis_name; - axis_v_ct = Z_LEN; + axis_v_len = Z_LEN; } /* Axis name shadows */ copy_v3_fl(c, 0.0f); c[axis] = 0.3f; for (int j = 0; j < SHADOW_RES; ++j) { - for (int i = 0; i < axis_v_ct; ++i) { + for (int i = 0; i < axis_v_len; ++i) { float tmp[2]; add_v2_v2v2(tmp, axis_verts[i], axis_name_shadow[j]); set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, @@ -2379,7 +2379,7 @@ Gwn_Batch *DRW_cache_bone_arrows_get(void) /* Axis name */ copy_v3_fl(c, 0.1f); c[axis] = 1.0f; - for (int i = 0; i < axis_v_ct; ++i) { + for (int i = 0; i < axis_v_len; ++i) { set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, &v, &a, axis_verts[i], c); } @@ -2456,7 +2456,7 @@ Gwn_Batch *DRW_cache_camera_get(void) if (!SHC.drw_camera) { static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); } @@ -2489,7 +2489,7 @@ Gwn_Batch *DRW_cache_camera_frame_get(void) static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); } @@ -2515,7 +2515,7 @@ Gwn_Batch *DRW_cache_camera_tria_get(void) if (!SHC.drw_camera_tria) { static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); } @@ -2552,7 +2552,7 @@ Gwn_Batch *DRW_cache_single_vert_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -2985,9 +2985,9 @@ Gwn_Batch *DRW_cache_particles_get_prim(int type) case PART_DRAW_CROSS: if (!SHC.drw_particle_cross) { static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, axis_id; + static uint pos_id, axis_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -3032,9 +3032,9 @@ Gwn_Batch *DRW_cache_particles_get_prim(int type) case PART_DRAW_AXIS: if (!SHC.drw_particle_axis) { static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, axis_id; + static uint pos_id, axis_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -3083,9 +3083,9 @@ Gwn_Batch *DRW_cache_particles_get_prim(int type) int axis = -1; static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, axis_id; + static uint pos_id, axis_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -3125,24 +3125,24 @@ Gwn_Batch *DRW_cache_cursor_get(bool crosshair_lines) const float f20 = 1.0f; const int segments = 16; - const int vert_ct = segments + 8; - const int index_ct = vert_ct + 5; + const int vert_len = segments + 8; + const int index_len = vert_len + 5; - unsigned char red[3] = {255, 0, 0}; - unsigned char white[3] = {255, 255, 255}; + uchar red[3] = {255, 0, 0}; + uchar white[3] = {255, 255, 255}; static Gwn_VertFormat format = { 0 }; static struct { uint pos, color; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.color = GWN_vertformat_attr_add(&format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); } Gwn_IndexBufBuilder elb; - GWN_indexbuf_init_ex(&elb, GWN_PRIM_LINE_STRIP, index_ct, vert_ct, true); + GWN_indexbuf_init_ex(&elb, GWN_PRIM_LINE_STRIP, index_len, vert_len, true); Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(vbo, vert_ct); + GWN_vertbuf_data_alloc(vbo, vert_len); int v = 0; for (int i = 0; i < segments; ++i) { @@ -3161,7 +3161,7 @@ Gwn_Batch *DRW_cache_cursor_get(bool crosshair_lines) GWN_indexbuf_add_generic_vert(&elb, 0); if (crosshair_lines) { - unsigned char crosshair_color[3]; + uchar crosshair_color[3]; UI_GetThemeColor3ubv(TH_VIEW_OVERLAY, crosshair_color); GWN_indexbuf_add_primitive_restart(&elb); diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c index 1bf34953dc6..4de1dfd24f5 100644 --- a/source/blender/draw/intern/draw_cache_impl_curve.c +++ b/source/blender/draw/intern/draw_cache_impl_curve.c @@ -503,7 +503,7 @@ static Gwn_VertBuf *curve_batch_cache_get_wire_verts(CurveRenderData *rdata, Cur if (cache->wire.verts == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -581,7 +581,7 @@ static Gwn_VertBuf *curve_batch_cache_get_normal_verts(CurveRenderData *rdata, C if (cache->normal.verts == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -675,7 +675,7 @@ static void curve_batch_cache_create_overlay_batches(Curve *cu) if (cache->overlay.verts == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_U8, 1, GWN_FETCH_INT); @@ -743,7 +743,7 @@ static void curve_batch_cache_create_overlay_batches(Curve *cu) static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_U8, 1, GWN_FETCH_INT); @@ -850,7 +850,7 @@ static Gwn_Batch *curve_batch_cache_get_overlay_select(CurveRenderData *rdata, C EditFont *ef = rdata->text.edit_font; static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -924,7 +924,7 @@ static Gwn_Batch *curve_batch_cache_get_overlay_cursor(CurveRenderData *rdata, C if (cache->text.cursor == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } diff --git a/source/blender/draw/intern/draw_cache_impl_displist.c b/source/blender/draw/intern/draw_cache_impl_displist.c index 3eecff024a1..8d187af0501 100644 --- a/source/blender/draw/intern/draw_cache_impl_displist.c +++ b/source/blender/draw/intern/draw_cache_impl_displist.c @@ -122,7 +122,7 @@ Gwn_VertBuf *DRW_displist_vertbuf_calc_pos_with_normals(ListBase *lb) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); @@ -228,7 +228,7 @@ Gwn_Batch **DRW_displist_batch_calc_tri_pos_normals_and_uv_split_by_material(Lis static Gwn_VertFormat shaded_triangles_format = { 0 }; static struct { uint pos, nor, uv; } attr_id; - if (shaded_triangles_format.attrib_ct == 0) { + if (shaded_triangles_format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&shaded_triangles_format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&shaded_triangles_format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); diff --git a/source/blender/draw/intern/draw_cache_impl_lattice.c b/source/blender/draw/intern/draw_cache_impl_lattice.c index 6046d9854fb..99dce2d7343 100644 --- a/source/blender/draw/intern/draw_cache_impl_lattice.c +++ b/source/blender/draw/intern/draw_cache_impl_lattice.c @@ -507,7 +507,7 @@ static void lattice_batch_cache_create_overlay_batches(Lattice *lt) if (cache->overlay_verts == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_U8, 1, GWN_FETCH_INT); diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index eafcfb007e7..7a72622cb9e 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -116,10 +116,10 @@ typedef struct EdgeAdjacentVerts { } EdgeAdjacentVerts; typedef struct EdgeDrawAttr { - unsigned char v_flag; - unsigned char e_flag; - unsigned char crease; - unsigned char bweight; + uchar v_flag; + uchar e_flag; + uchar crease; + uchar bweight; } EdgeDrawAttr; typedef struct MeshRenderData { @@ -1349,9 +1349,9 @@ enum { * (see gpu_shader_edit_mesh_overlay_geom.glsl) */ }; -static unsigned char mesh_render_data_looptri_flag(MeshRenderData *rdata, const BMFace *efa) +static uchar mesh_render_data_looptri_flag(MeshRenderData *rdata, const BMFace *efa) { - unsigned char fflag = 0; + uchar fflag = 0; if (efa == rdata->efa_act) fflag |= VFLAG_FACE_ACTIVE; @@ -1397,10 +1397,10 @@ static void mesh_render_data_edge_flag( } } -static unsigned char mesh_render_data_vertex_flag(MeshRenderData *rdata, const BMVert *eve) +static uchar mesh_render_data_vertex_flag(MeshRenderData *rdata, const BMVert *eve) { - unsigned char vflag = 0; + uchar vflag = 0; /* Current vertex */ if (eve == rdata->eve_act) @@ -1417,8 +1417,8 @@ static void add_overlay_tri( const uint pos_id, const uint vnor_id, const uint lnor_id, const uint data_id, const BMLoop **bm_looptri, const int base_vert_idx) { - unsigned char fflag; - unsigned char vflag; + uchar fflag; + uchar vflag; if (vbo_pos) { /* TODO(sybren): deduplicate this and all the other places it's pasted to in this file. */ @@ -1528,7 +1528,7 @@ static void add_overlay_loose_vert( } if (vbo_data) { - unsigned char vflag[4] = {0, 0, 0, 0}; + uchar vflag[4] = {0, 0, 0, 0}; vflag[0] = mesh_render_data_vertex_flag(rdata, eve); GWN_vertbuf_attr_set(vbo_data, data_id, base_vert_idx, vflag); } @@ -1634,7 +1634,7 @@ typedef struct MeshBatchCache { * set srgb conversion for auto attribs.*/ char *auto_layer_names; int *auto_layer_is_srgb; - int auto_layer_ct; + int auto_layer_len; /* settings to determine if cache is invalid */ bool is_maybe_dirty; @@ -1947,22 +1947,22 @@ static Gwn_VertBuf *mesh_batch_cache_get_tri_shading_data(MeshRenderData *rdata, uint auto_names_len = 0; uint auto_ofs = 0; uint auto_id = 0; - cache->auto_layer_ct = 0; + cache->auto_layer_len = 0; for (uint i = 0; i < uv_len; i++) { const char *attrib_name = mesh_render_data_uv_auto_layer_uuid_get(rdata, i); auto_names_len += strlen(attrib_name) + 2; /* include null terminator and b prefix. */ - cache->auto_layer_ct++; + cache->auto_layer_len++; } for (uint i = 0; i < vcol_len; i++) { if (rdata->cd.layers.auto_vcol[i]) { const char *attrib_name = mesh_render_data_vcol_auto_layer_uuid_get(rdata, i); auto_names_len += strlen(attrib_name) + 2; /* include null terminator and b prefix. */ - cache->auto_layer_ct++; + cache->auto_layer_len++; } } auto_names_len += 1; /* add an ultimate '\0' terminator */ cache->auto_layer_names = MEM_callocN(auto_names_len * sizeof(char), "Auto layer name buf"); - cache->auto_layer_is_srgb = MEM_mallocN(cache->auto_layer_ct * sizeof(int), "Auto layer value buf"); + cache->auto_layer_is_srgb = MEM_mallocN(cache->auto_layer_len * sizeof(int), "Auto layer value buf"); for (uint i = 0; i < uv_len; i++) { /* UV */ @@ -2159,7 +2159,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_tri_uv_active( static Gwn_VertFormat format = { 0 }; static struct { uint uv; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.uv = GWN_vertformat_attr_add(&format, "uv", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -2222,7 +2222,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_tri_pos_and_normals_ex( if (*r_vbo == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); } @@ -2374,7 +2374,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_facedot_pos_with_normals_and_flag( if (cache->ed_fcenter_pos_with_nor_and_sel == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.data = GWN_vertformat_attr_add(&format, "norAndFlag", GWN_COMP_I10, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); } @@ -2418,7 +2418,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_edges_visible( if (cache->ed_edge_pos == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -2463,7 +2463,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_verts_visible( if (cache->ed_vert_pos == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -2513,7 +2513,7 @@ static Gwn_VertBuf *mesh_create_facedot_select_id( { static Gwn_VertFormat format = { 0 }; static struct { uint pos, col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -2561,7 +2561,7 @@ static Gwn_VertBuf *mesh_create_edges_select_id( { static Gwn_VertFormat format = { 0 }; static struct { uint pos, col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -2611,7 +2611,7 @@ static Gwn_VertBuf *mesh_create_verts_select_id( { static Gwn_VertFormat format = { 0 }; static struct { uint pos, col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -2671,7 +2671,7 @@ static Gwn_VertBuf *mesh_create_tri_weights( static Gwn_VertFormat format = { 0 }; static struct { uint col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -2731,7 +2731,7 @@ static Gwn_VertBuf *mesh_create_tri_vert_colors( static Gwn_VertFormat format = { 0 }; static struct { uint col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); } @@ -2791,7 +2791,7 @@ static Gwn_VertBuf *mesh_create_tri_select_id( static Gwn_VertFormat format = { 0 }; static struct { uint col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -2847,7 +2847,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_vert_pos_and_nor_in_order( if (cache->pos_in_order == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* Normal is padded so that the vbo can be used as a buffer texture */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I16, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); @@ -2886,8 +2886,8 @@ static Gwn_VertBuf *mesh_batch_cache_get_vert_pos_and_nor_in_order( static Gwn_VertFormat *edit_mesh_overlay_pos_format(uint *r_pos_id) { static Gwn_VertFormat format_pos = { 0 }; - static unsigned pos_id; - if (format_pos.attrib_ct == 0) { + static uint pos_id; + if (format_pos.attr_len == 0) { pos_id = GWN_vertformat_attr_add(&format_pos, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } *r_pos_id = pos_id; @@ -2898,8 +2898,8 @@ static Gwn_VertFormat *edit_mesh_overlay_nor_format(uint *r_vnor_id, uint *r_lno { static Gwn_VertFormat format_nor = { 0 }; static Gwn_VertFormat format_nor_loop = { 0 }; - static unsigned vnor_id, vnor_loop_id, lnor_id; - if (format_nor.attrib_ct == 0) { + static uint vnor_id, vnor_loop_id, lnor_id; + if (format_nor.attr_len == 0) { vnor_id = GWN_vertformat_attr_add(&format_nor, "vnor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); vnor_loop_id = GWN_vertformat_attr_add(&format_nor_loop, "vnor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); lnor_id = GWN_vertformat_attr_add(&format_nor_loop, "lnor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); @@ -2918,8 +2918,8 @@ static Gwn_VertFormat *edit_mesh_overlay_nor_format(uint *r_vnor_id, uint *r_lno static Gwn_VertFormat *edit_mesh_overlay_data_format(uint *r_data_id) { static Gwn_VertFormat format_flag = { 0 }; - static unsigned data_id; - if (format_flag.attrib_ct == 0) { + static uint data_id; + if (format_flag.attr_len == 0) { data_id = GWN_vertformat_attr_add(&format_flag, "data", GWN_COMP_U8, 4, GWN_FETCH_INT); } *r_data_id = data_id; @@ -3420,7 +3420,7 @@ static Gwn_VertBuf *mesh_batch_cache_create_edges_overlay_texture_buf(MeshRender int j, j_next; for (j = 2, j_next = 0; j_next < 3; j = j_next++) { MEdge *ed = &medge[mloop[mlt->tri[j]].e]; - unsigned int tri_edge[2] = {mloop[mlt->tri[j]].v, mloop[mlt->tri[j_next]].v}; + uint tri_edge[2] = {mloop[mlt->tri[j]].v, mloop[mlt->tri[j_next]].v}; if (((ed->v1 == tri_edge[0]) && (ed->v2 == tri_edge[1])) || ((ed->v1 == tri_edge[1]) && (ed->v2 == tri_edge[0]))) @@ -3657,7 +3657,7 @@ static Gwn_VertBuf *mesh_create_edge_pos_with_sel( static Gwn_VertFormat format = { 0 }; static struct { uint pos, sel; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.sel = GWN_vertformat_attr_add(&format, "select", GWN_COMP_U8, 1, GWN_FETCH_INT); } @@ -3744,7 +3744,7 @@ static Gwn_VertBuf *mesh_create_vert_pos_with_overlay_data( static Gwn_VertFormat format = { 0 }; static struct { uint data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_I8, 1, GWN_FETCH_INT); } @@ -3997,7 +3997,7 @@ Gwn_Batch *DRW_mesh_batch_cache_get_fancy_edges(Mesh *me) /* create batch from DM */ static Gwn_VertFormat format = { 0 }; static struct { uint pos, n1, n2; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.n1 = GWN_vertformat_attr_add(&format, "N1", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); @@ -4330,7 +4330,7 @@ Gwn_Batch **DRW_mesh_batch_cache_get_surface_shaded( if (auto_layer_names) { *auto_layer_names = cache->auto_layer_names; *auto_layer_is_srgb = cache->auto_layer_is_srgb; - *auto_layer_count = cache->auto_layer_ct; + *auto_layer_count = cache->auto_layer_len; } return cache->shaded_triangles; diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 28693b47c89..df67d34d566 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -66,8 +66,8 @@ static void particle_batch_cache_clear(ParticleSystem *psys); typedef struct ParticlePointCache { Gwn_VertBuf *pos; Gwn_Batch *points; - int elems_count; - int point_count; + int elems_len; + int point_len; } ParticlePointCache; typedef struct ParticleBatchCache { @@ -82,11 +82,11 @@ typedef struct ParticleBatchCache { Gwn_VertBuf *edit_inner_pos; Gwn_Batch *edit_inner_points; - int edit_inner_point_count; + int edit_inner_point_len; Gwn_VertBuf *edit_tip_pos; Gwn_Batch *edit_tip_points; - int edit_tip_point_count; + int edit_tip_point_len; /* Settings to determine if cache is invalid. */ bool is_dirty; @@ -225,9 +225,9 @@ static void count_cache_segment_keys( for (int i = 0; i < num_path_cache_keys; i++) { ParticleCacheKey *path = pathcache[i]; if (path->segments > 0) { - hair_cache->strands_count++; - hair_cache->elems_count += path->segments + 2; - hair_cache->point_count += path->segments + 1; + hair_cache->strands_len++; + hair_cache->elems_len += path->segments + 2; + hair_cache->point_len += path->segments + 1; } } } @@ -243,9 +243,9 @@ static void ensure_seg_pt_count( return; } - hair_cache->strands_count = 0; - hair_cache->elems_count = 0; - hair_cache->point_count = 0; + hair_cache->strands_len = 0; + hair_cache->elems_len = 0; + hair_cache->point_len = 0; if (edit != NULL && edit->pathcache != NULL) { count_cache_segment_keys(edit->pathcache, edit->totcached, hair_cache); @@ -263,7 +263,7 @@ static void ensure_seg_pt_count( } } -static void particle_pack_mcol(MCol *mcol, unsigned short r_scol[3]) +static void particle_pack_mcol(MCol *mcol, ushort r_scol[3]) { /* Convert to linear ushort and swizzle */ r_scol[0] = unit_float_to_ushort_clamp(BLI_color_from_srgb_table[mcol->b]); @@ -573,7 +573,7 @@ static int particle_batch_cache_fill_segments( } for (int k = 0; k < num_col_layers; k++) { /* TODO Put the conversion outside the loop */ - unsigned short scol[4]; + ushort scol[4]; particle_pack_mcol( (is_simple && is_child) ? &(*r_parent_mcol)[psys->child[i].parent][k] : &mcol[k], @@ -600,7 +600,7 @@ static int particle_batch_cache_fill_segments( } for (int k = 0; k < num_col_layers; k++) { /* TODO Put the conversion outside the loop */ - unsigned short scol[4]; + ushort scol[4]; particle_pack_mcol( (is_simple && is_child) ? &(*r_parent_mcol)[psys->child[i].parent][k] : &mcol[k], @@ -734,7 +734,7 @@ static int particle_batch_cache_fill_strands_data( copy_v2_v2(t_uv, uv[k]); } for (int k = 0; k < num_col_layers; k++) { - unsigned short *scol = (unsigned short *)GWN_vertbuf_raw_step(col_step + k); + ushort *scol = (ushort *)GWN_vertbuf_raw_step(col_step + k); particle_pack_mcol( (is_simple && is_child) ? &(*r_parent_mcol)[psys->child[i].parent][k] : &mcol[k], @@ -761,7 +761,7 @@ static void particle_batch_cache_ensure_procedural_final_points( /* Create a destination buffer for the tranform feedback. Sized appropriately */ /* Thoses are points! not line segments. */ - GWN_vertbuf_data_alloc(cache->final[subdiv].proc_buf, cache->final[subdiv].strands_res * cache->strands_count); + GWN_vertbuf_data_alloc(cache->final[subdiv].proc_buf, cache->final[subdiv].strands_res * cache->strands_len); /* Create vbo immediatly to bind to texture buffer. */ GWN_vertbuf_use(cache->final[subdiv].proc_buf); @@ -814,13 +814,13 @@ static void particle_batch_cache_ensure_procedural_strand_data( /* Strand Data */ cache->proc_strand_buf = GWN_vertbuf_create_with_format(&format_data); - GWN_vertbuf_data_alloc(cache->proc_strand_buf, cache->strands_count); + GWN_vertbuf_data_alloc(cache->proc_strand_buf, cache->strands_len); GWN_vertbuf_attr_get_raw_data(cache->proc_strand_buf, data_id, &data_step); /* UV layers */ for (int i = 0; i < cache->num_uv_layers; i++) { cache->proc_uv_buf[i] = GWN_vertbuf_create_with_format(&format_uv); - GWN_vertbuf_data_alloc(cache->proc_uv_buf[i], cache->strands_count); + GWN_vertbuf_data_alloc(cache->proc_uv_buf[i], cache->strands_len); GWN_vertbuf_attr_get_raw_data(cache->proc_uv_buf[i], uv_id, &uv_step[i]); const char *name = CustomData_get_layer_name(&psmd->mesh_final->ldata, CD_MLOOPUV, i); @@ -836,7 +836,7 @@ static void particle_batch_cache_ensure_procedural_strand_data( /* Vertex colors */ for (int i = 0; i < cache->num_col_layers; i++) { cache->proc_col_buf[i] = GWN_vertbuf_create_with_format(&format_col); - GWN_vertbuf_data_alloc(cache->proc_col_buf[i], cache->strands_count); + GWN_vertbuf_data_alloc(cache->proc_col_buf[i], cache->strands_len); GWN_vertbuf_attr_get_raw_data(cache->proc_col_buf[i], col_id, &col_step[i]); const char *name = CustomData_get_layer_name(&psmd->mesh_final->ldata, CD_MLOOPCOL, i); @@ -942,7 +942,7 @@ static void particle_batch_cache_ensure_procedural_indices( int verts_per_hair = cache->final[subdiv].strands_res * thickness_res; /* +1 for primitive restart */ - int element_count = (verts_per_hair + 1) * cache->strands_count; + int element_count = (verts_per_hair + 1) * cache->strands_len; Gwn_PrimType prim_type = (thickness_res == 1) ? GWN_PRIM_LINE_STRIP : GWN_PRIM_TRI_STRIP; static Gwn_VertFormat format = { 0 }; @@ -997,7 +997,7 @@ static void particle_batch_cache_ensure_procedural_pos( uint pos_id = GWN_vertformat_attr_add(&format, "posTime", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); cache->proc_point_buf = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(cache->proc_point_buf, cache->point_count); + GWN_vertbuf_data_alloc(cache->proc_point_buf, cache->point_len); Gwn_VertBufRaw pos_step; GWN_vertbuf_attr_get_raw_data(cache->proc_point_buf, pos_id, &pos_step); @@ -1109,13 +1109,13 @@ static void particle_batch_cache_ensure_pos_and_seg( } hair_cache->pos = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(hair_cache->pos, hair_cache->point_count); + GWN_vertbuf_data_alloc(hair_cache->pos, hair_cache->point_len); Gwn_IndexBufBuilder elb; GWN_indexbuf_init_ex( &elb, GWN_PRIM_LINE_STRIP, - hair_cache->elems_count, hair_cache->point_count, + hair_cache->elems_len, hair_cache->point_len, true); if (num_uv_layers || num_col_layers) { @@ -1196,7 +1196,7 @@ static void particle_batch_cache_ensure_pos( } static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, rot_id, val_id; + static uint pos_id, rot_id, val_id; int i, curr_point; ParticleData *pa; ParticleKey state; @@ -1219,7 +1219,7 @@ static void particle_batch_cache_ensure_pos( GWN_VERTBUF_DISCARD_SAFE(point_cache->pos); - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); rot_id = GWN_vertformat_attr_add(&format, "rot", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); @@ -1392,11 +1392,11 @@ static void ensure_edit_inner_points_count( if (cache->edit_inner_pos != NULL) { return; } - cache->edit_inner_point_count = 0; + cache->edit_inner_point_len = 0; for (int point_index = 0; point_index < edit->totpoint; point_index++) { const PTCacheEditPoint *point = &edit->points[point_index]; BLI_assert(point->totkey >= 1); - cache->edit_inner_point_count += (point->totkey - 1); + cache->edit_inner_point_len += (point->totkey - 1); } } @@ -1420,18 +1420,18 @@ static void particle_batch_cache_ensure_edit_inner_pos( } static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, color_id; + static uint pos_id, color_id; GWN_VERTBUF_DISCARD_SAFE(cache->edit_inner_pos); - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); color_id = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); } cache->edit_inner_pos = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(cache->edit_inner_pos, cache->edit_inner_point_count); + GWN_vertbuf_data_alloc(cache->edit_inner_pos, cache->edit_inner_point_len); float selected_color[4], normal_color[4]; edit_colors_get(edit, selected_color, normal_color); @@ -1479,7 +1479,7 @@ static void ensure_edit_tip_points_count( if (cache->edit_tip_pos != NULL) { return; } - cache->edit_tip_point_count = edit->totpoint; + cache->edit_tip_point_len = edit->totpoint; } static void particle_batch_cache_ensure_edit_tip_pos( @@ -1491,18 +1491,18 @@ static void particle_batch_cache_ensure_edit_tip_pos( } static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, color_id; + static uint pos_id, color_id; GWN_VERTBUF_DISCARD_SAFE(cache->edit_tip_pos); - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); color_id = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); } cache->edit_tip_pos = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(cache->edit_tip_pos, cache->edit_tip_point_count); + GWN_vertbuf_data_alloc(cache->edit_tip_pos, cache->edit_tip_point_len); float selected_color[4], normal_color[4]; edit_colors_get(edit, selected_color, normal_color); diff --git a/source/blender/draw/intern/draw_hair.c b/source/blender/draw/intern/draw_hair.c index 8320ae55179..6ede573199f 100644 --- a/source/blender/draw/intern/draw_hair.c +++ b/source/blender/draw/intern/draw_hair.c @@ -137,14 +137,14 @@ static DRWShadingGroup *drw_shgroup_create_hair_procedural_ex( /* Transform Feedback subdiv. */ if (need_ft_update) { - int final_points_ct = hair_cache->final[subdiv].strands_res * hair_cache->strands_count; + int final_points_len = hair_cache->final[subdiv].strands_res * hair_cache->strands_len; GPUShader *tf_shader = hair_refine_shader_get(PART_REFINE_CATMULL_ROM); DRWShadingGroup *tf_shgrp = DRW_shgroup_transform_feedback_create(tf_shader, g_tf_pass, hair_cache->final[subdiv].proc_buf); DRW_shgroup_uniform_texture(tf_shgrp, "hairPointBuffer", hair_cache->point_tex); DRW_shgroup_uniform_texture(tf_shgrp, "hairStrandBuffer", hair_cache->strand_tex); DRW_shgroup_uniform_int(tf_shgrp, "hairStrandsRes", &hair_cache->final[subdiv].strands_res, 1); - DRW_shgroup_call_procedural_points_add(tf_shgrp, final_points_ct, NULL); + DRW_shgroup_call_procedural_points_add(tf_shgrp, final_points_len, NULL); } return shgrp; diff --git a/source/blender/draw/intern/draw_hair_private.h b/source/blender/draw/intern/draw_hair_private.h index 2e6c9a0d3c1..17acd7e6259 100644 --- a/source/blender/draw/intern/draw_hair_private.h +++ b/source/blender/draw/intern/draw_hair_private.h @@ -31,7 +31,7 @@ #define __DRAW_HAIR_PRIVATE_H__ #define MAX_LAYER_NAME_CT 3 /* u0123456789, u, a0123456789 */ -#define MAX_LAYER_NAME_LEN DECIMAL_DIGITS_BOUND(unsigned int) + 2 +#define MAX_LAYER_NAME_LEN DECIMAL_DIGITS_BOUND(uint) + 2 #define MAX_THICKRES 2 /* see eHairType */ #define MAX_HAIR_SUBDIV 4 /* see hair_subdiv rna */ @@ -76,9 +76,9 @@ typedef struct ParticleHairCache { ParticleHairFinalCache final[MAX_HAIR_SUBDIV]; - int strands_count; - int elems_count; - int point_count; + int strands_len; + int elems_len; + int point_len; } ParticleHairCache; bool particles_ensure_procedural_data( diff --git a/source/blender/draw/intern/draw_instance_data.c b/source/blender/draw/intern/draw_instance_data.c index 3e4f812af27..e322d4780d5 100644 --- a/source/blender/draw/intern/draw_instance_data.c +++ b/source/blender/draw/intern/draw_instance_data.c @@ -213,10 +213,10 @@ void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist) for (int i = 0; i < batching->alloc_size; i++, bbuf++) { if (bbuf->shgroup != NULL) { realloc_size = i + 1; - uint vert_ct = DRW_shgroup_get_instance_count(bbuf->shgroup); - vert_ct += (vert_ct == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */ - if (vert_ct + BUFFER_VERTS_CHUNK <= bbuf->vert->vertex_ct) { - uint size = vert_ct + BUFFER_VERTS_CHUNK - 1; + uint vert_len = DRW_shgroup_get_instance_count(bbuf->shgroup); + vert_len += (vert_len == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */ + if (vert_len + BUFFER_VERTS_CHUNK <= bbuf->vert->vertex_len) { + uint size = vert_len + BUFFER_VERTS_CHUNK - 1; size = size - size % BUFFER_VERTS_CHUNK; GWN_vertbuf_data_resize(bbuf->vert, size); } @@ -245,10 +245,10 @@ void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist) for (int i = 0; i < instancing->alloc_size; i++, ibuf++) { if (ibuf->shgroup != NULL) { realloc_size = i + 1; - uint vert_ct = DRW_shgroup_get_instance_count(ibuf->shgroup); - vert_ct += (vert_ct == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */ - if (vert_ct + BUFFER_VERTS_CHUNK <= ibuf->vert->vertex_ct) { - uint size = vert_ct + BUFFER_VERTS_CHUNK - 1; + uint vert_len = DRW_shgroup_get_instance_count(ibuf->shgroup); + vert_len += (vert_len == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */ + if (vert_len + BUFFER_VERTS_CHUNK <= ibuf->vert->vertex_len) { + uint size = vert_len + BUFFER_VERTS_CHUNK - 1; size = size - size % BUFFER_VERTS_CHUNK; GWN_vertbuf_data_resize(ibuf->vert, size); } diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 26e5365a6fd..30f7742fd35 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1370,9 +1370,12 @@ void DRW_draw_render_loop_ex( drw_engines_cache_init(); drw_engines_world_update(scene); + const int object_type_exclude_viewport = v3d->object_type_exclude_viewport; DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN(depsgraph, ob) { - drw_engines_cache_populate(ob); + if ((object_type_exclude_viewport & (1 << ob->type)) == 0) { + drw_engines_cache_populate(ob); + } } DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END; @@ -1645,12 +1648,17 @@ void DRW_render_object_iter( void *vedata, RenderEngine *engine, struct Depsgraph *depsgraph, void (*callback)(void *vedata, Object *ob, RenderEngine *engine, struct Depsgraph *depsgraph)) { + const DRWContextState *draw_ctx = DRW_context_state_get(); + DRW_hair_init(); + const int object_type_exclude_viewport = draw_ctx->v3d ? draw_ctx->v3d->object_type_exclude_viewport : 0; DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN(depsgraph, ob) { - DST.ob_state = NULL; - callback(vedata, ob, engine, depsgraph); + if ((object_type_exclude_viewport & (1 << ob->type)) == 0) { + DST.ob_state = NULL; + callback(vedata, ob, engine, depsgraph); + } } DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END } @@ -1840,6 +1848,9 @@ void DRW_draw_select_loop( #endif } else { + const int object_type_exclude_select = ( + v3d->object_type_exclude_viewport | v3d->object_type_exclude_select + ); bool filter_exclude = false; DEG_OBJECT_ITER_BEGIN( depsgraph, ob, @@ -1847,8 +1858,9 @@ void DRW_draw_select_loop( DEG_ITER_OBJECT_FLAG_VISIBLE | DEG_ITER_OBJECT_FLAG_DUPLI) { - if ((ob->base_flag & BASE_SELECTABLE) != 0) { - + if ((ob->base_flag & BASE_SELECTABLE) && + (object_type_exclude_select & (1 << ob->type)) == 0) + { if (object_filter_fn != NULL) { if (ob->base_flag & BASE_FROMDUPLI) { /* pass (use previous filter_exclude value) */ @@ -2020,9 +2032,12 @@ void DRW_draw_depth_loop( drw_engines_cache_init(); drw_engines_world_update(scene); + const int object_type_exclude_viewport = v3d->object_type_exclude_viewport; DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN(depsgraph, ob) { - drw_engines_cache_populate(ob); + if ((object_type_exclude_viewport & (1 << ob->type)) == 0) { + drw_engines_cache_populate(ob); + } } DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END; diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h index 9954754990f..6eae3459c2b 100644 --- a/source/blender/draw/intern/draw_manager.h +++ b/source/blender/draw/intern/draw_manager.h @@ -106,8 +106,8 @@ typedef struct DRWCallState { DRWCallVisibilityFn *visibility_cb; void *user_data; - unsigned char flag; - unsigned char cache_id; /* Compared with DST.state_cache_id to see if matrices are still valid. */ + uchar flag; + uchar cache_id; /* Compared with DST.state_cache_id to see if matrices are still valid. */ uint16_t matflag; /* Which matrices to compute. */ /* Culling: Using Bounding Sphere for now for faster culling. * Not ideal for planes. */ @@ -308,7 +308,7 @@ typedef struct DRWManager { DRWInstanceData *object_instance_data[MAX_INSTANCE_DATA_SIZE]; /* State of the object being evaluated if already allocated. */ DRWCallState *ob_state; - unsigned char state_cache_id; /* Could be larger but 254 view changes is already a lot! */ + uchar state_cache_id; /* Could be larger but 254 view changes is already a lot! */ /* Rendering state */ GPUShader *shader; diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index db4e16d362a..c259633982e 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -412,9 +412,9 @@ static void drw_shgroup_call_procedural_add_ex( BLI_LINKS_APPEND(&shgroup->calls, call); } -void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, uint point_count, float (*obmat)[4]) +void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, uint point_len, float (*obmat)[4]) { - drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_POINTS, point_count, obmat, NULL); + drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_POINTS, point_len, obmat, NULL); } void DRW_shgroup_call_procedural_lines_add(DRWShadingGroup *shgroup, uint line_count, float (*obmat)[4]) @@ -553,7 +553,7 @@ void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup *shgroup, const void *at { #ifdef USE_GPU_SELECT if (G.f & G_PICKSEL) { - if (shgroup->instance_count == shgroup->inst_selectid->vertex_ct) { + if (shgroup->instance_count == shgroup->inst_selectid->vertex_len) { GWN_vertbuf_data_resize(shgroup->inst_selectid, shgroup->instance_count + 32); } GWN_vertbuf_attr_set(shgroup->inst_selectid, 0, shgroup->instance_count, &DST.select_id); @@ -564,7 +564,7 @@ void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup *shgroup, const void *at UNUSED_VARS_NDEBUG(attr_len); for (int i = 0; i < attr_len; ++i) { - if (shgroup->instance_count == shgroup->instance_vbo->vertex_ct) { + if (shgroup->instance_count == shgroup->instance_vbo->vertex_len) { GWN_vertbuf_data_resize(shgroup->instance_vbo, shgroup->instance_count + 32); } GWN_vertbuf_attr_set(shgroup->instance_vbo, i, shgroup->instance_count, attr[i]); @@ -651,7 +651,7 @@ static void drw_shgroup_instance_init( shgroup->instance_geom = batch; #ifndef NDEBUG - shgroup->attribs_count = format->attrib_ct; + shgroup->attribs_count = format->attr_len; #endif DRW_instancing_buffer_request(DST.idatalist, format, batch, shgroup, @@ -662,7 +662,7 @@ static void drw_shgroup_instance_init( /* Not actually used for rendering but alloced in one chunk. * Plus we don't have to care about ownership. */ static Gwn_VertFormat inst_select_format = {0}; - if (inst_select_format.attrib_ct == 0) { + if (inst_select_format.attr_len == 0) { GWN_vertformat_attr_add(&inst_select_format, "selectId", GWN_COMP_I32, 1, GWN_FETCH_INT); } Gwn_Batch *batch_dummy; /* Not used */ @@ -679,7 +679,7 @@ static void drw_shgroup_batching_init( drw_shgroup_init(shgroup, shader); #ifndef NDEBUG - shgroup->attribs_count = (format != NULL) ? format->attrib_ct : 0; + shgroup->attribs_count = (format != NULL) ? format->attr_len : 0; #endif BLI_assert(format != NULL); @@ -698,7 +698,7 @@ static void drw_shgroup_batching_init( if (G.f & G_PICKSEL) { /* Not actually used for rendering but alloced in one chunk. */ static Gwn_VertFormat inst_select_format = {0}; - if (inst_select_format.attrib_ct == 0) { + if (inst_select_format.attr_len == 0) { GWN_vertformat_attr_add(&inst_select_format, "selectId", GWN_COMP_I32, 1, GWN_FETCH_INT); } Gwn_Batch *batch; /* Not used */ diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 03692fd9475..5957643d090 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -419,10 +419,10 @@ void DRW_state_invert_facing(void) * and if the shaders have support for it (see usage of gl_ClipDistance). * Be sure to call DRW_state_clip_planes_reset() after you finish drawing. **/ -void DRW_state_clip_planes_count_set(uint plane_ct) +void DRW_state_clip_planes_count_set(uint plane_len) { - BLI_assert(plane_ct <= MAX_CLIP_PLANES); - DST.num_clip_planes = plane_ct; + BLI_assert(plane_len <= MAX_CLIP_PLANES); + DST.num_clip_planes = plane_len; } void DRW_state_clip_planes_reset(void) diff --git a/source/blender/draw/intern/draw_manager_text.c b/source/blender/draw/intern/draw_manager_text.c index 1f385b958b8..977374a00c5 100644 --- a/source/blender/draw/intern/draw_manager_text.c +++ b/source/blender/draw/intern/draw_manager_text.c @@ -46,7 +46,7 @@ typedef struct ViewCachedString { struct ViewCachedString *next, *prev; float vec[3]; union { - unsigned char ub[4]; + uchar ub[4]; int pack; } col; short sco[2]; @@ -79,7 +79,7 @@ void DRW_text_cache_add( const float co[3], const char *str, const int str_len, short xoffs, short flag, - const unsigned char col[4]) + const uchar col[4]) { int alloc_len; ViewCachedString *vos; diff --git a/source/blender/draw/intern/draw_manager_text.h b/source/blender/draw/intern/draw_manager_text.h index a675a200924..14c33be4cf8 100644 --- a/source/blender/draw/intern/draw_manager_text.h +++ b/source/blender/draw/intern/draw_manager_text.h @@ -34,7 +34,7 @@ void DRW_text_cache_add( const float co[3], const char *str, const int str_len, short xoffs, short flag, - const unsigned char col[4]); + const uchar col[4]); void DRW_text_cache_draw(struct DRWTextStore *dt, struct ARegion *ar); diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index 347932619b9..59ae8a918f9 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -79,7 +79,7 @@ void DRW_draw_region_info(void) /* ************************* Grid ************************** */ -static void gridline_range(double x0, double dx, double max, int *r_first, int *r_count) +static void gridline_range(double x0, double dx, double max, int *r_first, int *r_len) { /* determine range of gridlines that appear in this Area -- similar calc but separate ranges for x & y * x0 is gridline 0, the axis in screen space @@ -90,11 +90,11 @@ static void gridline_range(double x0, double dx, double max, int *r_first, int * if (first <= last) { *r_first = first; - *r_count = last - first + 1; + *r_len = last - first + 1; } else { *r_first = 0; - *r_count = 0; + *r_len = 0; } } @@ -104,19 +104,19 @@ static int gridline_count(ARegion *ar, double x0, double y0, double dx) * dx is the frequency, shared by x & y directions * pass in dx of smallest (highest precision) grid we want to draw */ - int first, x_ct, y_ct; + int first, x_len, y_len; - gridline_range(x0, dx, ar->winx, &first, &x_ct); - gridline_range(y0, dx, ar->winy, &first, &y_ct); + gridline_range(x0, dx, ar->winx, &first, &x_len); + gridline_range(y0, dx, ar->winy, &first, &y_len); - int total_ct = x_ct + y_ct; + int total_len = x_len + y_len; - return total_ct; + return total_len; } static bool drawgrid_draw( ARegion *ar, double x0, double y0, double dx, int skip_mod, - unsigned pos, unsigned col, GLubyte col_value[3]) + uint pos, uint col, GLubyte col_value[3]) { /* skip every skip_mod lines relative to each axis; they will be overlaid by another drawgrid_draw * always skip exact x0 & y0 axes; they will be drawn later in color @@ -129,7 +129,7 @@ static bool drawgrid_draw( const float y_max = (float)ar->winy; int first, ct; - int x_ct = 0, y_ct = 0; /* count of lines actually drawn */ + int x_len = 0, y_len = 0; /* count of lines actually drawn */ int lines_skipped_for_next_unit = 0; /* draw vertical lines */ @@ -143,13 +143,13 @@ static bool drawgrid_draw( continue; } - if (x_ct == 0) + if (x_len == 0) immAttrib3ub(col, col_value[0], col_value[1], col_value[2]); float x = (float)(x0 + i * dx); immVertex2f(pos, x, 0.0f); immVertex2f(pos, x, y_max); - ++x_ct; + ++x_len; } /* draw horizontal lines */ @@ -163,13 +163,13 @@ static bool drawgrid_draw( continue; } - if (x_ct + y_ct == 0) + if (x_len + y_len == 0) immAttrib3ub(col, col_value[0], col_value[1], col_value[2]); float y = (float)(y0 + i * dx); immVertex2f(pos, 0.0f, y); immVertex2f(pos, x_max, y); - ++y_ct; + ++y_len; } return lines_skipped_for_next_unit > 0; @@ -220,7 +220,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); - unsigned char col[3], col2[3]; + uchar col[3], col2[3]; UI_GetThemeColor3ubv(TH_GRID, col); if (unit->system) { @@ -249,11 +249,11 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** *grid_unit = bUnit_GetNameDisplay(usys, i); rv3d->gridview = (float)((scalar * (double)v3d->grid) / (double)unit->scale_length); - int gridline_ct = gridline_count(ar, x, y, dx_scalar); - if (gridline_ct == 0) + int gridline_len = gridline_count(ar, x, y, dx_scalar); + if (gridline_len == 0) goto drawgrid_cleanup; /* nothing to draw */ - immBegin(GWN_PRIM_LINES, gridline_ct * 2); + immBegin(GWN_PRIM_LINES, gridline_len * 2); } float blend_fac = 1.0f - ((GRID_MIN_PX_F * 2.0f) / (float)dx_scalar); @@ -302,11 +302,11 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** } } - int gridline_ct = gridline_count(ar, x, y, dx); - if (gridline_ct == 0) + int gridline_len = gridline_count(ar, x, y, dx); + if (gridline_len == 0) goto drawgrid_cleanup; /* nothing to draw */ - immBegin(GWN_PRIM_LINES, gridline_ct * 2); + immBegin(GWN_PRIM_LINES, gridline_len * 2); if (grids_to_draw == 2) { UI_GetThemeColorBlend3ubv(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0), col2); @@ -369,17 +369,17 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) bool show_axis_y = (v3d->gridflag & V3D_SHOW_Y) != 0; bool show_axis_z = (v3d->gridflag & V3D_SHOW_Z) != 0; - unsigned char col_grid[3], col_axis[3]; + uchar col_grid[3], col_axis[3]; glLineWidth(1.0f); UI_GetThemeColor3ubv(TH_GRID, col_grid); if (show_floor) { - const unsigned vertex_ct = 2 * (gridlines * 4 + 2); + const uint vertex_len = 2 * (gridlines * 4 + 2); const int sublines = v3d->gridsubdiv; - unsigned char col_bg[3], col_grid_emphasise[3], col_grid_light[3]; + uchar col_bg[3], col_grid_emphasise[3], col_grid_light[3]; Gwn_VertFormat *format = immVertexFormat(); uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); @@ -387,7 +387,7 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); - immBegin(GWN_PRIM_LINES, vertex_ct); + immBegin(GWN_PRIM_LINES, vertex_len); /* draw normal grid lines */ UI_GetColorPtrShade3ubv(col_grid, col_grid_light, 10); @@ -583,9 +583,9 @@ void DRW_draw_background(void) glDisable(GL_DEPTH_TEST); Gwn_VertFormat *format = immVertexFormat(); - unsigned pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); - unsigned char col_hi[3], col_lo[3]; + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uchar col_hi[3], col_lo[3]; gpuPushMatrix(); gpuLoadIdentity(); diff --git a/source/blender/draw/modes/edit_mesh_mode_text.c b/source/blender/draw/modes/edit_mesh_mode_text.c index def96e79eba..56a015d0e6b 100644 --- a/source/blender/draw/modes/edit_mesh_mode_text.c +++ b/source/blender/draw/modes/edit_mesh_mode_text.c @@ -63,7 +63,7 @@ void DRW_edit_mesh_mode_text_measure_stats( char numstr[32]; /* Stores the measurement display text here */ size_t numstr_len; const char *conv_float; /* Use a float conversion matching the grid size */ - unsigned char col[4] = {0, 0, 0, 255}; /* color of the text to draw */ + uchar col[4] = {0, 0, 0, 255}; /* color of the text to draw */ float area; /* area of the face */ float grid = unit->system ? unit->scale_length : v3d->grid; const bool do_split = (unit->flag & USER_UNIT_OPT_SPLIT) != 0; diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 332c480aa89..2ac16906102 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -2129,10 +2129,6 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) return; } - if (v3d->overlay.object_type_exclude & (1 << ob->type)) { - return; - } - bool do_outlines = (draw_ctx->v3d->flag & V3D_SELECT_OUTLINE) && ((ob->base_flag & BASE_SELECTED) != 0); bool show_relations = ((draw_ctx->v3d->flag & V3D_HIDE_HELPLINES) == 0); @@ -2278,7 +2274,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) if ((ob->dtx & OB_DRAWNAME) && DRW_state_show_text()) { struct DRWTextStore *dt = DRW_text_cache_ensure(); - unsigned char color[4]; + uchar color[4]; UI_GetThemeColor4ubv(theme_id, color); DRW_text_cache_add( diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 6bd333294c5..c70790e0550 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -146,7 +146,7 @@ static void acf_generic_dataexpand_backdrop(bAnimContext *ac, bAnimListElem *ale short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0; float color[3]; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); /* set backdrop drawing color */ acf->get_backdrop_color(ac, ale, color); @@ -235,7 +235,7 @@ static void acf_generic_channel_backdrop(bAnimContext *ac, bAnimListElem *ale, f short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0; float color[3]; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); /* set backdrop drawing color */ acf->get_backdrop_color(ac, ale, color); @@ -638,7 +638,7 @@ static int acf_object_icon(bAnimListElem *ale) /* icon depends on object-type */ switch (ob->type) { case OB_LAMP: - return ICON_OUTLINER_OB_LAMP; + return ICON_OUTLINER_OB_LIGHT; case OB_MESH: return ICON_OUTLINER_OB_MESH; case OB_CAMERA: @@ -1452,16 +1452,16 @@ static bAnimChannelType ACF_DSMAT = acf_dsmat_setting_ptr /* pointer for setting */ }; -/* Lamp Expander ------------------------------------------- */ +/* Light Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dslam_icon(bAnimListElem *UNUSED(ale)) +static int acf_dslight_icon(bAnimListElem *UNUSED(ale)) { - return ICON_LAMP_DATA; + return ICON_LIGHT_DATA; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dslam_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg) +static int acf_dslight_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg) { /* clear extra return data first */ *neg = false; @@ -1486,7 +1486,7 @@ static int acf_dslam_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Setting } /* get pointer to the setting */ -static void *acf_dslam_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type) +static void *acf_dslight_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type) { Lamp *la = (Lamp *)ale->data; @@ -1510,9 +1510,9 @@ static void *acf_dslam_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings set } /* lamp expander type define */ -static bAnimChannelType ACF_DSLAM = +static bAnimChannelType ACF_DSLIGHT = { - "Lamp Expander", /* type name */ + "Light Expander", /* type name */ ACHANNEL_ROLE_EXPANDER, /* role */ acf_generic_dataexpand_color, /* backdrop color */ @@ -1521,12 +1521,12 @@ static bAnimChannelType ACF_DSLAM = acf_generic_basic_offset, /* offset */ acf_generic_idblock_name, /* name */ - acf_generic_idblock_name_prop, /* name prop */ - acf_dslam_icon, /* icon */ + acf_generic_idblock_name_prop, /* name prop */ + acf_dslight_icon, /* icon */ acf_generic_dataexpand_setting_valid, /* has setting */ - acf_dslam_setting_flag, /* flag for setting */ - acf_dslam_setting_ptr /* pointer for setting */ + acf_dslight_setting_flag, /* flag for setting */ + acf_dslight_setting_ptr /* pointer for setting */ }; /* Texture Expander ------------------------------------------- */ @@ -3580,7 +3580,7 @@ static void ANIM_init_channel_typeinfo_data(void) animchannelTypeInfo[type++] = &ACF_FILLDRIVERS; /* Drivers Expander */ animchannelTypeInfo[type++] = &ACF_DSMAT; /* Material Channel */ - animchannelTypeInfo[type++] = &ACF_DSLAM; /* Lamp Channel */ + animchannelTypeInfo[type++] = &ACF_DSLIGHT; /* Light Channel */ animchannelTypeInfo[type++] = &ACF_DSCAM; /* Camera Channel */ animchannelTypeInfo[type++] = &ACF_DSCACHEFILE; /* CacheFile Channel */ animchannelTypeInfo[type++] = &ACF_DSCUR; /* Curve Channel */ @@ -3868,7 +3868,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float /* for F-Curves, draw color-preview of curve behind checkbox */ if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) { FCurve *fcu = (FCurve *)ale->data; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -3924,7 +3924,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float /* draw red underline if channel is disabled */ if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE) && (ale->flag & FCURVE_DISABLED)) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -3952,7 +3952,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float short draw_sliders = 0; float ymin_ofs = 0.0f; float color[3]; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 953898a0586..51ba7d9c269 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -142,7 +142,7 @@ void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag) GPU_line_width((flag & DRAWCFRA_WIDE) ? 3.0 : 2.0); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -171,7 +171,7 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width) GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShadeAlpha(TH_ANIM_ACTIVE, -25, -30); @@ -204,7 +204,7 @@ void ANIM_draw_framerange(Scene *scene, View2D *v2d) GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShadeAlpha(TH_BACK, -25, -100); diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 5f03704f9f5..c5f7782dcee 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -486,7 +486,7 @@ void ED_markers_draw(const bContext *C, int flag) v2d = UI_view2d_fromcontext(C); if (flag & DRAW_MARKERS_MARGIN) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); const unsigned char shade[4] = {0, 0, 0, 16}; diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index fcccf07190b..78ce24db503 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -585,20 +585,20 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa copy_v4_v4(unsel_mhcol, unsel_color); unsel_mhcol[3] *= 0.8f; - unsigned int block_ct = 0; + uint block_len = 0; for (ActKeyBlock *ab = blocks->first; ab; ab = ab->next) { if (actkeyblock_is_valid(ab, keys)) { - block_ct++; + block_len++; } } - if (block_ct > 0) { + if (block_len > 0) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); - immBegin(GWN_PRIM_TRIS, 6 * block_ct); + immBegin(GWN_PRIM_TRIS, 6 * block_len); for (ActKeyBlock *ab = blocks->first; ab; ab = ab->next) { if (actkeyblock_is_valid(ab, keys)) { if (ab->flag & ACTKEYBLOCK_FLAG_MOVING_HOLD) { @@ -622,25 +622,25 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa if (keys) { /* count keys */ - unsigned int key_ct = 0; + uint key_len = 0; for (ActKeyColumn *ak = keys->first; ak; ak = ak->next) { /* optimization: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw * - this might give some improvements, since we current have to flip between view/region matrices */ if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax)) - key_ct++; + key_len++; } - if (key_ct > 0) { + if (key_len > 0) { /* draw keys */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); - unsigned int outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); GPU_enable_program_point_size(); - immBegin(GWN_PRIM_POINTS, key_ct); + immBegin(GWN_PRIM_POINTS, key_len); for (ActKeyColumn *ak = keys->first; ak; ak = ak->next) { if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax)) { diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index 5e3fec93340..ce72a5ffc9f 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -430,7 +430,7 @@ static void curve_draw_stroke_3d(const struct bContext *UNUSED(C), ARegion *UNUS { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); GPU_depth_test(false); diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index a79a5052eb8..ec4310213ef 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -151,8 +151,8 @@ static void gp_draw_stroke_buffer_fill(const tGPspoint *points, int totpoints, f /* draw triangulation data */ if (tot_triangles > 0) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); @@ -209,8 +209,8 @@ static void gp_draw_stroke_buffer(const tGPspoint *points, int totpoints, short } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); const tGPspoint *pt = points; @@ -320,9 +320,9 @@ static void gp_draw_stroke_volumetric_buffer(const tGPspoint *points, int totpoi return; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR); GPU_enable_program_point_size(); @@ -347,9 +347,9 @@ static void gp_draw_stroke_volumetric_2d(const bGPDspoint *points, int totpoints const float diff_mat[4][4], const float ink[4]) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR); GPU_enable_program_point_size(); @@ -380,9 +380,9 @@ static void gp_draw_stroke_volumetric_3d( const float ink[4]) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - unsigned int size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR); GPU_enable_program_point_size(); @@ -517,7 +517,7 @@ static void gp_draw_stroke_fill( } BLI_assert(gps->tot_triangles >= 1); - unsigned int pos; + uint pos; if (gps->flag & GP_STROKE_3DSPACE) { pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); @@ -576,7 +576,7 @@ static void gp_draw_stroke_point( mul_v3_m4v3(fpt, diff_mat, &pt->x); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); if (sflag & GP_STROKE_3DSPACE) { immBindBuiltinProgram(GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); @@ -618,8 +618,8 @@ static void gp_draw_stroke_3d(const bGPDspoint *points, int totpoints, short thi Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_3D_SMOOTH_COLOR); @@ -717,8 +717,8 @@ static void gp_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thi float fpt[3]; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); immBegin(GWN_PRIM_TRI_STRIP, totpoints * 2 + 4); @@ -1151,9 +1151,9 @@ static void gp_draw_strokes_edit( selectColor[3] = alpha; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos; /* specified later */ - unsigned int size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos; /* specified later */ + uint size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); if (gps->flag & GP_STROKE_3DSPACE) { pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 75e4c510bcf..0ddd8700c09 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -986,7 +986,7 @@ static void gp_brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customda if (brush) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_line_smooth(true); diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index 4c67a306e75..a63855439f4 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -119,7 +119,7 @@ DEF_ICON(FULLSCREEN_EXIT) DEF_ICON(BLANK1) // Not actually blank - this is used all over the place /* BUTTONS */ -DEF_ICON(LAMP) +DEF_ICON(LIGHT) DEF_ICON(MATERIAL) DEF_ICON(TEXTURE) DEF_ICON(ANIM) @@ -216,7 +216,7 @@ DEF_ICON(MESH_DATA) DEF_ICON(CURVE_DATA) DEF_ICON(META_DATA) DEF_ICON(LATTICE_DATA) -DEF_ICON(LAMP_DATA) +DEF_ICON(LIGHT_DATA) DEF_ICON(MATERIAL_DATA) DEF_ICON(TEXTURE_DATA) DEF_ICON(ANIM_DATA) @@ -304,7 +304,7 @@ DEF_ICON(OUTLINER_OB_MESH) DEF_ICON(OUTLINER_OB_CURVE) DEF_ICON(OUTLINER_OB_LATTICE) DEF_ICON(OUTLINER_OB_META) -DEF_ICON(OUTLINER_OB_LAMP) +DEF_ICON(OUTLINER_OB_LIGHT) DEF_ICON(OUTLINER_OB_CAMERA) DEF_ICON(OUTLINER_OB_ARMATURE) DEF_ICON(OUTLINER_OB_FONT) @@ -336,7 +336,7 @@ DEF_ICON(OUTLINER_DATA_MESH) DEF_ICON(OUTLINER_DATA_CURVE) DEF_ICON(OUTLINER_DATA_LATTICE) DEF_ICON(OUTLINER_DATA_META) -DEF_ICON(OUTLINER_DATA_LAMP) +DEF_ICON(OUTLINER_DATA_LIGHT) DEF_ICON(OUTLINER_DATA_CAMERA) DEF_ICON(OUTLINER_DATA_ARMATURE) DEF_ICON(OUTLINER_DATA_FONT) @@ -377,11 +377,11 @@ DEF_ICON(MESH_CAPSULE) #ifndef DEF_ICON_BLANK_SKIP DEF_ICON(BLANK611) #endif -DEF_ICON(LAMP_POINT) -DEF_ICON(LAMP_SUN) -DEF_ICON(LAMP_SPOT) -DEF_ICON(LAMP_HEMI) -DEF_ICON(LAMP_AREA) +DEF_ICON(LIGHT_POINT) +DEF_ICON(LIGHT_SUN) +DEF_ICON(LIGHT_SPOT) +DEF_ICON(LIGHT_HEMI) +DEF_ICON(LIGHT_AREA) #ifndef DEF_ICON_BLANK_SKIP DEF_ICON(BLANK617) DEF_ICON(BLANK618) @@ -1032,3 +1032,55 @@ DEF_VICO(COLORSET_17_VEC) DEF_VICO(COLORSET_18_VEC) DEF_VICO(COLORSET_19_VEC) DEF_VICO(COLORSET_20_VEC) + +/* Events */ +DEF_ICON(EVENT_A) +DEF_ICON(EVENT_B) +DEF_ICON(EVENT_C) +DEF_ICON(EVENT_D) +DEF_ICON(EVENT_E) +DEF_ICON(EVENT_F) +DEF_ICON(EVENT_G) +DEF_ICON(EVENT_H) +DEF_ICON(EVENT_I) +DEF_ICON(EVENT_J) +DEF_ICON(EVENT_K) +DEF_ICON(EVENT_L) +DEF_ICON(EVENT_M) +DEF_ICON(EVENT_N) +DEF_ICON(EVENT_O) +DEF_ICON(EVENT_P) +DEF_ICON(EVENT_Q) +DEF_ICON(EVENT_R) +DEF_ICON(EVENT_S) +DEF_ICON(EVENT_T) +DEF_ICON(EVENT_U) +DEF_ICON(EVENT_V) +DEF_ICON(EVENT_W) +DEF_ICON(EVENT_X) +DEF_ICON(EVENT_Y) +DEF_ICON(EVENT_Z) +DEF_ICON(EVENT_SHIFT) +DEF_ICON(EVENT_CTRL) +DEF_ICON(EVENT_ALT) +DEF_ICON(EVENT_OS) +DEF_ICON(EVENT_F1) +DEF_ICON(EVENT_F2) +DEF_ICON(EVENT_F3) +DEF_ICON(EVENT_F4) +DEF_ICON(EVENT_F5) +DEF_ICON(EVENT_F6) +DEF_ICON(EVENT_F7) +DEF_ICON(EVENT_F8) +DEF_ICON(EVENT_F9) +DEF_ICON(EVENT_F10) +DEF_ICON(EVENT_F11) +DEF_ICON(EVENT_F12) +DEF_ICON(EVENT_ESC) +DEF_ICON(EVENT_TAB) +DEF_ICON(EVENT_PAGEUP) +DEF_ICON(EVENT_PAGEDOWN) +DEF_ICON(EVENT_HOME) +DEF_ICON(EVENT_END) +DEF_ICON(EVENT_RETURN) +/* add as needed. */ diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 8a758d01809..d23748356fa 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -76,6 +76,7 @@ struct wmEvent; struct wmManipulator; struct wmMsgBus; struct wmKeyMap; +struct wmKeyMapItem; typedef struct uiBut uiBut; typedef struct uiBlock uiBlock; @@ -554,7 +555,7 @@ void UI_but_drag_set_path(uiBut *but, const char *path, const bool use_free); void UI_but_drag_set_name(uiBut *but, const char *name); void UI_but_drag_set_value(uiBut *but); void UI_but_drag_set_image( - uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale, const bool use_free); + uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale, const bool use_free); bool UI_but_active_drop_name(struct bContext *C); bool UI_but_active_drop_color(struct bContext *C); @@ -592,13 +593,14 @@ bool UI_but_online_manual_id_from_active( * - R: RNA * - O: operator */ -uiBut *uiDefBut(uiBlock *block, - int type, int retval, const char *str, - int x1, int y1, - short x2, short y2, - void *poin, - float min, float max, - float a1, float a2, const char *tip); +uiBut *uiDefBut( + uiBlock *block, + int type, int retval, const char *str, + int x1, int y1, + short x2, short y2, + void *poin, + float min, float max, + float a1, float a2, const char *tip); uiBut *uiDefButF(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefButI(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip); @@ -612,13 +614,14 @@ uiBut *uiDefButR_prop(uiBlock *block, int type, int retval, const char *str, int uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x, int y, short width, short height, const char *tip); uiBut *uiDefButO_ptr(uiBlock *block, int type, struct wmOperatorType *ot, int opcontext, const char *str, int x, int y, short width, short height, const char *tip); -uiBut *uiDefIconBut(uiBlock *block, - int type, int retval, int icon, - int x1, int y1, - short x2, short y2, - void *poin, - float min, float max, - float a1, float a2, const char *tip); +uiBut *uiDefIconBut( + uiBlock *block, + int type, int retval, int icon, + int x1, int y1, + short x2, short y2, + void *poin, + float min, float max, + float a1, float a2, const char *tip); uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip); @@ -632,13 +635,14 @@ uiBut *uiDefIconButR_prop(uiBlock *block, int type, int retval, int icon, int x, uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, int x, int y, short width, short height, const char *tip); uiBut *uiDefIconButO_ptr(uiBlock *block, int type, struct wmOperatorType *ot, int opcontext, int icon, int x, int y, short width, short height, const char *tip); -uiBut *uiDefIconTextBut(uiBlock *block, - int type, int retval, int icon, const char *str, - int x1, int y1, - short x2, short y2, - void *poin, - float min, float max, - float a1, float a2, const char *tip); +uiBut *uiDefIconTextBut( + uiBlock *block, + int type, int retval, int icon, const char *str, + int x1, int y1, + short x2, short y2, + void *poin, + float min, float max, + float a1, float a2, const char *tip); uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip); @@ -723,6 +727,9 @@ enum { int UI_icon_from_id(struct ID *id); int UI_icon_from_report_type(int type); +int UI_icon_from_event_type(short event_type, short event_value); +int UI_icon_from_keymap_item(const struct wmKeyMapItem *kmi, int r_icon_mod[4]); + uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip); uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip); uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, const char *str, int x, int y, short width, short height, const char *tip); @@ -738,9 +745,10 @@ uiBut *uiDefKeyevtButS(uiBlock *block, int retval, const char *str, int x, int y uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, int x, int y, short width, short height, short *keypoin, short *modkeypoin, const char *tip); uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, int x, int y, short width, short height, float a1, float a2, const char *tip); -uiBut *uiDefSearchButO_ptr(uiBlock *block, struct wmOperatorType *ot, struct IDProperty *properties, - void *arg, int retval, int icon, int maxlen, int x, int y, - short width, short height, float a1, float a2, const char *tip); +uiBut *uiDefSearchButO_ptr( + uiBlock *block, struct wmOperatorType *ot, struct IDProperty *properties, + void *arg, int retval, int icon, int maxlen, int x, int y, + short width, short height, float a1, float a2, const char *tip); /* For uiDefAutoButsRNA */ @@ -801,8 +809,9 @@ void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *argN); void UI_but_tooltip_refresh(struct bContext *C, uiBut *but); void UI_but_tooltip_timer_remove(struct bContext *C, uiBut *but); -bool UI_textbutton_activate_rna(const struct bContext *C, struct ARegion *ar, - const void *rna_poin_data, const char *rna_prop_id); +bool UI_textbutton_activate_rna( + const struct bContext *C, struct ARegion *ar, + const void *rna_poin_data, const char *rna_prop_id); bool UI_textbutton_activate_but(const struct bContext *C, uiBut *but); void UI_but_focus_on_enter_event(struct wmWindow *win, uiBut *but); @@ -836,9 +845,10 @@ void UI_panels_end(const struct bContext *C, struct ARegion *ar, int *x, int *y) void UI_panels_draw(const struct bContext *C, struct ARegion *ar); struct Panel *UI_panel_find_by_type(struct ListBase *lb, struct PanelType *pt); -struct Panel *UI_panel_begin(struct ScrArea *sa, struct ARegion *ar, struct ListBase *lb, - uiBlock *block, struct PanelType *pt, struct Panel *pa, - bool *r_open); +struct Panel *UI_panel_begin( + struct ScrArea *sa, struct ARegion *ar, struct ListBase *lb, + uiBlock *block, struct PanelType *pt, struct Panel *pa, + bool *r_open); void UI_panel_end(uiBlock *block, int width, int height); void UI_panels_scale(struct ARegion *ar, float new_width); void UI_panel_label_offset(struct uiBlock *block, int *x, int *y); @@ -998,8 +1008,9 @@ uiLayout *uiLayoutColumnFlow(uiLayout *layout, int number, bool align); uiLayout *uiLayoutGridFlow( uiLayout *layout, bool row_major, int columns_len, bool even_columns, bool even_rows, bool align); uiLayout *uiLayoutBox(uiLayout *layout); -uiLayout *uiLayoutListBox(uiLayout *layout, struct uiList *ui_list, struct PointerRNA *ptr, struct PropertyRNA *prop, - struct PointerRNA *actptr, struct PropertyRNA *actprop); +uiLayout *uiLayoutListBox( + uiLayout *layout, struct uiList *ui_list, struct PointerRNA *ptr, struct PropertyRNA *prop, + struct PointerRNA *actptr, struct PropertyRNA *actprop); uiLayout *uiLayoutAbsolute(uiLayout *layout, bool align); uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, bool align); uiLayout *uiLayoutOverlap(uiLayout *layout); @@ -1022,8 +1033,9 @@ void uiTemplateIDTabs( PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int filter); -void uiTemplateAnyID(uiLayout *layout, struct PointerRNA *ptr, const char *propname, - const char *proptypename, const char *text); +void uiTemplateAnyID( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, + const char *proptypename, const char *text); void uiTemplateSearch( uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, @@ -1035,27 +1047,31 @@ void uiTemplateSearchPreview( struct PointerRNA *searchptr, const char *searchpropname, const char *newop, const char *unlinkop, const int rows, const int cols); -void uiTemplatePathBuilder(uiLayout *layout, struct PointerRNA *ptr, const char *propname, - struct PointerRNA *root_ptr, const char *text); +void uiTemplatePathBuilder( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, + struct PointerRNA *root_ptr, const char *text); uiLayout *uiTemplateModifier(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr); void uiTemplateOperatorRedoProperties(uiLayout *layout, const struct bContext *C); uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr); -void uiTemplatePreview(uiLayout *layout, struct bContext *C, struct ID *id, bool show_buttons, struct ID *parent, - struct MTex *slot, const char *preview_id); +void uiTemplatePreview( + uiLayout *layout, struct bContext *C, struct ID *id, bool show_buttons, struct ID *parent, + struct MTex *slot, const char *preview_id); void uiTemplateColorRamp(uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool expand); void uiTemplateIcon(uiLayout *layout, int icon_value, float icon_scale); void uiTemplateIconView(uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool show_labels, float icon_scale); void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, const char *propname); void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, const char *propname); void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, const char *propname); -void uiTemplateCurveMapping(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int type, - bool levels, bool brush, bool neg_slope); +void uiTemplateCurveMapping( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, int type, + bool levels, bool brush, bool neg_slope); void uiTemplateColorPicker(uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool value_slider, bool lock, bool lock_luminosity, bool cubic); void uiTemplatePalette(uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool color); -void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, const char *propname, - PointerRNA *used_ptr, const char *used_propname, int active_layer); +void uiTemplateLayers( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, + PointerRNA *used_ptr, const char *used_propname, int active_layer); void uiTemplateImage(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *userptr, bool compact, bool multiview); void uiTemplateImageSettings(uiLayout *layout, struct PointerRNA *imfptr, bool color_management); void uiTemplateImageStereo3d(uiLayout *layout, struct PointerRNA *stereo3d_format_ptr); @@ -1082,10 +1098,11 @@ void uiTemplateCacheFile(uiLayout *layout, struct bContext *C, struct PointerRNA /* Default UIList class name, keep in sync with its declaration in bl_ui/__init__.py */ #define UI_UL_DEFAULT_CLASS_NAME "UI_UL_list" -void uiTemplateList(uiLayout *layout, struct bContext *C, const char *listtype_name, const char *list_id, - struct PointerRNA *dataptr, const char *propname, struct PointerRNA *active_dataptr, - const char *active_propname, const char *item_dyntip_propname, - int rows, int maxrows, int layout_type, int columns); +void uiTemplateList( + uiLayout *layout, struct bContext *C, const char *listtype_name, const char *list_id, + struct PointerRNA *dataptr, const char *propname, struct PointerRNA *active_dataptr, + const char *active_propname, const char *item_dyntip_propname, + int rows, int maxrows, int layout_type, int columns); void uiTemplateNodeLink(uiLayout *layout, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input); void uiTemplateNodeView(uiLayout *layout, struct bContext *C, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input); void uiTemplateTextureUser(uiLayout *layout, struct bContext *C); @@ -1201,14 +1218,18 @@ uiBut *UI_region_active_but_get(struct ARegion *ar); /* Styled text draw */ void UI_fontstyle_set(const struct uiFontStyle *fs); -void UI_fontstyle_draw_ex(const struct uiFontStyle *fs, const struct rcti *rect, const char *str, - const unsigned char col[4], size_t len, float *r_xofs, float *r_yofs); -void UI_fontstyle_draw(const struct uiFontStyle *fs, const struct rcti *rect, const char *str, - const unsigned char col[4]); -void UI_fontstyle_draw_rotated(const struct uiFontStyle *fs, const struct rcti *rect, const char *str, - const unsigned char col[4]); -void UI_fontstyle_draw_simple(const struct uiFontStyle *fs, float x, float y, const char *str, - const unsigned char col[4]); +void UI_fontstyle_draw_ex( + const struct uiFontStyle *fs, const struct rcti *rect, const char *str, + const unsigned char col[4], size_t len, float *r_xofs, float *r_yofs); +void UI_fontstyle_draw( + const struct uiFontStyle *fs, const struct rcti *rect, const char *str, + const unsigned char col[4]); +void UI_fontstyle_draw_rotated( + const struct uiFontStyle *fs, const struct rcti *rect, const char *str, + const unsigned char col[4]); +void UI_fontstyle_draw_simple( + const struct uiFontStyle *fs, float x, float y, const char *str, + const unsigned char col[4]); void UI_fontstyle_draw_simple_backdrop( const struct uiFontStyle *fs, float x, float y, const char *str, const float col_fg[4], const float col_bg[4]); diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index ee18f956cac..cf172441be1 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -54,6 +54,7 @@ set(SRC interface_eyedropper_driver.c interface_handlers.c interface_icons.c + interface_icons_event.c interface_layout.c interface_ops.c interface_panel.c diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 427f5621177..20361bde16f 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -3454,6 +3454,12 @@ static void ui_def_but_rna__menu(bContext *UNUSED(C), uiLayout *layout, void *bu block->flag |= UI_BLOCK_IS_FLIP; } +static void ui_but_submenu_enable(uiBlock *block, uiBut *but) +{ + but->flag |= UI_BUT_ICON_SUBMENU; + block->content_hints |= BLOCK_CONTAINS_SUBMENU_BUT; +} + /** * ui_def_but_rna_propname and ui_def_but_rna * both take the same args except for propname vs prop, this is done so we can @@ -3589,7 +3595,7 @@ static uiBut *ui_def_but_rna( } if ((type == UI_BTYPE_MENU) && (but->dt == UI_EMBOSS_PULLDOWN)) { - but->flag |= UI_BUT_ICON_SUBMENU; + ui_but_submenu_enable(block, but); } const char *info; @@ -4328,7 +4334,7 @@ uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, in ui_def_but_icon(but, icon, UI_HAS_ICON); but->drawflag |= UI_BUT_ICON_LEFT; - but->flag |= UI_BUT_ICON_SUBMENU; + ui_but_submenu_enable(block, but); but->menu_create_func = func; ui_but_update(but); @@ -4360,7 +4366,7 @@ uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, but->drawflag |= UI_BUT_ICON_LEFT; } but->flag |= UI_HAS_ICON; - but->flag |= UI_BUT_ICON_SUBMENU; + ui_but_submenu_enable(block, but); but->block_create_func = func; ui_but_update(but); diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index c336c48f62a..0a8a6d1f832 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -159,23 +159,23 @@ void UI_draw_roundbox_4fv(bool filled, float minx, float miny, float maxx, float int a; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); /* mult */ for (a = 0; a < 7; a++) { mul_v2_fl(vec[a], rad); } - unsigned int vert_ct = 0; - vert_ct += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 9 : 1; - vert_ct += (roundboxtype & UI_CNR_TOP_RIGHT) ? 9 : 1; - vert_ct += (roundboxtype & UI_CNR_TOP_LEFT) ? 9 : 1; - vert_ct += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 9 : 1; + uint vert_len = 0; + vert_len += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 9 : 1; + vert_len += (roundboxtype & UI_CNR_TOP_RIGHT) ? 9 : 1; + vert_len += (roundboxtype & UI_CNR_TOP_LEFT) ? 9 : 1; + vert_len += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 9 : 1; immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(col); - immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_LOOP, vert_ct); + immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_LOOP, vert_len); /* start with corner right-bottom */ if (roundboxtype & UI_CNR_BOTTOM_RIGHT) { immVertex2f(pos, maxx - rad, miny); @@ -280,8 +280,8 @@ void UI_draw_roundbox_shade_x( int a; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); @@ -432,8 +432,8 @@ void UI_draw_roundbox_shade_y( } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); @@ -535,7 +535,7 @@ void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const flo int ofs_y = 4 * U.pixelsize; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(color); @@ -550,8 +550,8 @@ void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const flo void ui_draw_but_TAB_outline(const rcti *rect, float rad, unsigned char highlight[3], unsigned char highlight_fade[3]) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); /* add a 1px offset, looks nicer */ const int minx = rect->xmin + U.pixelsize, maxx = rect->xmax - U.pixelsize; const int miny = rect->ymin + U.pixelsize, maxy = rect->ymax - U.pixelsize; @@ -818,7 +818,7 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUS (rect.ymax + 1) - (rect.ymin - 1)); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -869,7 +869,7 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUS static void waveform_draw_one(float *waveform, int nbr, const float col[3]) { Gwn_VertFormat format = {0}; - unsigned int pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format); GWN_vertbuf_data_alloc(vbo, nbr); @@ -957,7 +957,7 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSE GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1215,7 +1215,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UN (rect.ymax + 1) - (rect.ymin - 1)); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1404,7 +1404,7 @@ static void ui_draw_colorband_handle( void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti *rect) { struct ColorManagedDisplay *display = NULL; - unsigned int position, color; + uint pos_id, col_id; ColorBand *coba = (ColorBand *)(but->editcoba ? but->editcoba : but->poin); if (coba == NULL) return; @@ -1419,20 +1419,20 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti float y1 = rect->ymin; Gwn_VertFormat *format = immVertexFormat(); - position = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_CHECKER); /* Drawing the checkerboard. */ immUniform4f("color1", UI_ALPHA_CHECKER_DARK / 255.0f, UI_ALPHA_CHECKER_DARK / 255.0f, UI_ALPHA_CHECKER_DARK / 255.0f, 1.0f); immUniform4f("color2", UI_ALPHA_CHECKER_LIGHT / 255.0f, UI_ALPHA_CHECKER_LIGHT / 255.0f, UI_ALPHA_CHECKER_LIGHT / 255.0f, 1.0f); immUniform1i("size", 8); - immRectf(position, x1, y1, x1 + sizex, rect->ymax); + immRectf(pos_id, x1, y1, x1 + sizex, rect->ymax); immUnbindProgram(); /* New format */ format = immVertexFormat(); - position = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + col_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); /* layer: color ramp */ @@ -1455,9 +1455,9 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti v1[0] = v2[0] = x1 + a; - immAttrib4fv(color, colf); - immVertex2fv(position, v1); - immVertex2fv(position, v2); + immAttrib4fv(col_id, colf); + immVertex2fv(pos_id, v1); + immVertex2fv(pos_id, v2); } immEnd(); @@ -1474,9 +1474,9 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti v1[0] = v2[0] = x1 + a; - immAttrib4f(color, colf[0], colf[1], colf[2], 1.0f); - immVertex2fv(position, v1); - immVertex2fv(position, v2); + immAttrib4f(col_id, colf[0], colf[1], colf[2], 1.0f); + immVertex2fv(pos_id, v1); + immVertex2fv(pos_id, v2); } immEnd(); @@ -1486,27 +1486,27 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti /* New format */ format = immVertexFormat(); - position = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* layer: box outline */ immUniformColor4f(0.0f, 0.0f, 0.0f, 1.0f); - imm_draw_box_wire_2d(position, x1, y1, x1 + sizex, rect->ymax); + imm_draw_box_wire_2d(pos_id, x1, y1, x1 + sizex, rect->ymax); /* layer: box outline */ GPU_blend(true); immUniformColor4f(0.0f, 0.0f, 0.0f, 0.5f); immBegin(GWN_PRIM_LINES, 2); - immVertex2f(position, x1, y1); - immVertex2f(position, x1 + sizex, y1); + immVertex2f(pos_id, x1, y1); + immVertex2f(pos_id, x1 + sizex, y1); immEnd(); immUniformColor4f(1.0f, 1.0f, 1.0f, 0.25f); immBegin(GWN_PRIM_LINES, 2); - immVertex2f(position, x1, y1 - 1); - immVertex2f(position, x1 + sizex, y1 - 1); + immVertex2f(pos_id, x1, y1 - 1); + immVertex2f(pos_id, x1 + sizex, y1 - 1); immEnd(); GPU_blend(false); @@ -1515,7 +1515,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti for (int a = 0; a < coba->tot; a++, cbd++) { if (a != coba->cur) { float pos = x1 + cbd->pos * (sizex - 1) + 1; - ui_draw_colorband_handle(position, rect, pos, &cbd->r, display, false); + ui_draw_colorband_handle(pos_id, rect, pos, &cbd->r, display, false); } } @@ -1523,7 +1523,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti if (coba->tot != 0) { cbd = &coba->data[coba->cur]; float pos = x1 + cbd->pos * (sizex - 1) + 1; - ui_draw_colorband_handle(position, rect, pos, &cbd->r, display, true); + ui_draw_colorband_handle(pos_id, rect, pos, &cbd->r, display, true); } immUnbindProgram(); @@ -1568,7 +1568,7 @@ void ui_draw_but_UNITVEC(uiBut *but, uiWidgetColors *wcol, const rcti *rect) /* AA circle */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ubv((unsigned char *)wcol->inner); @@ -1675,7 +1675,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti GPU_line_width(1.0f); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* backdrop */ @@ -1807,7 +1807,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti /* the points, use aspect to make them visible on edges */ format = immVertexFormat(); pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); cmp = cuma->curve; @@ -1926,8 +1926,8 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *U BLI_rctf_size_y(&rect)); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); UI_GetThemeColor4fv(TH_SEL_MARKER, col_sel); @@ -2018,7 +2018,7 @@ void ui_draw_but_NODESOCKET(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol float y = 0.5f * (recti->ymin + recti->ymax); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv(but->col); @@ -2115,8 +2115,8 @@ void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx, GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index c3246213d4e..9c5a4392f78 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -108,6 +108,7 @@ typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha); #define ICON_TYPE_BUFFER 3 #define ICON_TYPE_VECTOR 4 #define ICON_TYPE_GEOM 5 +#define ICON_TYPE_EVENT 6 /* draw keymap entries using custom renderer. */ typedef struct DrawInfo { int type; @@ -126,6 +127,14 @@ typedef struct DrawInfo { struct { int x, y, w, h; } texture; + struct { + /* Can be packed into a single int. */ + short event_type; + short event_value; + int icon; + /* Allow lookups. */ + struct DrawInfo *next; + } input; } data; } DrawInfo; @@ -241,7 +250,7 @@ static void vicon_small_tri_right_draw(int x, int y, int w, int UNUSED(h), float viconutil_set_point(pts[1], cx - d2, cy - d); viconutil_set_point(pts[2], cx + d2, cy); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4f(0.2f, 0.2f, 0.2f, alpha); @@ -272,10 +281,10 @@ static void vicon_keytype_draw_wrapper(int x, int y, int w, int h, float alpha, int yco = y + h / 2; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); - unsigned int outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); GPU_enable_program_point_size(); @@ -334,7 +343,7 @@ static void vicon_colorset_draw(int index, int x, int y, int w, int h, float UNU const int b = x + w / 3 * 2; const int c = x + w; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* XXX: Include alpha into this... */ @@ -437,6 +446,143 @@ static void init_brush_icons(void) #undef INIT_BRUSH_ICON } +static DrawInfo *g_di_event_list = NULL; + +int UI_icon_from_event_type(short event_type, short event_value) +{ + if (event_type == RIGHTSHIFTKEY) { + event_type = LEFTSHIFTKEY; + } + else if (event_type == RIGHTCTRLKEY) { + event_type = LEFTCTRLKEY; + } + else if (event_type == RIGHTALTKEY) { + event_type = LEFTALTKEY; + } + else if (event_type == EVT_TWEAK_L) { + event_type = LEFTMOUSE; + event_value = KM_CLICK_DRAG; + } + else if (event_type == EVT_TWEAK_M) { + event_type = MIDDLEMOUSE; + event_value = KM_CLICK_DRAG; + } + else if (event_type == EVT_TWEAK_R) { + event_type = RIGHTMOUSE; + event_value = KM_CLICK_DRAG; + } + + DrawInfo *di = g_di_event_list; + do { + if (di->data.input.event_type == event_type) { + return di->data.input.icon; + } + } while ((di = di->data.input.next)); + + if (event_type == LEFTMOUSE) { + return ELEM(event_value, KM_CLICK, KM_PRESS) ? ICON_MOUSE_LMB : ICON_MOUSE_LMB_DRAG; + } + else if (event_type == MIDDLEMOUSE) { + return ELEM(event_value, KM_CLICK, KM_PRESS) ? ICON_MOUSE_MMB : ICON_MOUSE_MMB_DRAG; + } + else if (event_type == RIGHTMOUSE) { + return ELEM(event_value, KM_CLICK, KM_PRESS) ? ICON_MOUSE_RMB : ICON_MOUSE_RMB_DRAG; + } + + return ICON_NONE; +} + +int UI_icon_from_keymap_item(const wmKeyMapItem *kmi, int r_icon_mod[4]) +{ + if (r_icon_mod) { + memset(r_icon_mod, 0x0, sizeof(int[4])); + int i = 0; + if (!ELEM(kmi->ctrl, KM_NOTHING, KM_ANY)) { + r_icon_mod[i++] = ICON_EVENT_CTRL; + } + if (!ELEM(kmi->alt, KM_NOTHING, KM_ANY)) { + r_icon_mod[i++] = ICON_EVENT_ALT; + } + if (!ELEM(kmi->shift, KM_NOTHING, KM_ANY)) { + r_icon_mod[i++] = ICON_EVENT_SHIFT; + } + if (!ELEM(kmi->oskey, KM_NOTHING, KM_ANY)) { + r_icon_mod[i++] = ICON_EVENT_OS; + } + } + return UI_icon_from_event_type(kmi->type, kmi->val); +} + +static void init_event_icons(void) +{ + DrawInfo *di_next = NULL; + +#define INIT_EVENT_ICON(icon_id, type, value) \ + { \ + DrawInfo *di = def_internal_icon(NULL, icon_id, 0, 0, w, ICON_TYPE_EVENT); \ + di->data.input.event_type = type; \ + di->data.input.event_value = value; \ + di->data.input.icon = icon_id; \ + di->data.input.next = di_next; \ + di_next = di; \ + } + /* end INIT_EVENT_ICON */ + + const int w = 16; /* DUMMY */ + + INIT_EVENT_ICON(ICON_EVENT_A, AKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_B, BKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_C, CKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_D, DKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_E, EKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F, FKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_G, GKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_H, HKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_I, IKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_J, JKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_K, KKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_L, LKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_M, MKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_N, NKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_O, OKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_P, PKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_Q, QKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_R, RKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_S, SKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_T, TKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_U, UKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_V, VKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_W, WKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_X, XKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_Y, YKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_Z, ZKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_SHIFT, LEFTSHIFTKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_CTRL, LEFTCTRLKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_ALT, LEFTALTKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_OS, OSKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F1, F1KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F2, F2KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F3, F3KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F4, F4KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F5, F5KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F6, F6KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F7, F7KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F8, F8KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F9, F9KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F10, F10KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F11, F11KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F12, F12KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_ESC, ESCKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_TAB, TABKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_PAGEUP, PAGEUPKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_PAGEDOWN, PAGEDOWNKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_RETURN, RETKEY, KM_ANY); + + g_di_event_list = di_next; + +#undef INIT_EVENT_ICON +} + static void icon_verify_datatoc(IconImage *iimg) { /* if it has own rect, things are all OK */ @@ -795,6 +941,7 @@ void UI_icons_init(int first_dyn_id) init_iconfile_list(&iconfilelist); init_internal_icons(); init_brush_icons(); + init_event_icons(); #endif } @@ -1285,6 +1432,11 @@ static void icon_draw_size( icon_draw_rect(x, y, w, h, aspect, w, h, ibuf->rect, alpha, rgb, desaturate); GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); } + else if (di->type == ICON_TYPE_EVENT) { + const short event_type = di->data.input.event_type; + const short event_value = di->data.input.event_value; + icon_draw_rect_input(x, y, w, h, alpha, event_type, event_value); + } else if (di->type == ICON_TYPE_TEXTURE) { /* texture image use premul alpha for correct scaling */ GPU_blend_set_func(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); @@ -1554,7 +1706,7 @@ int UI_idcode_icon_get(const int idcode) case ID_IM: return ICON_IMAGE_DATA; case ID_LA: - return ICON_LAMP_DATA; + return ICON_LIGHT_DATA; case ID_LS: return ICON_LINE_DATA; case ID_LT: diff --git a/source/blender/editors/interface/interface_icons_event.c b/source/blender/editors/interface/interface_icons_event.c new file mode 100644 index 00000000000..dc444b98b2c --- /dev/null +++ b/source/blender/editors/interface/interface_icons_event.c @@ -0,0 +1,295 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/editors/interface/interface_icons_event.c + * \ingroup edinterface + * + * A special set of icons to represent input devices, + * this is a mix of text (via fonts) and a handful of custom glyphs for special keys. + * + * Event codes are used as identifiers. + */ + +#include <math.h> +#include <stdlib.h> +#include <string.h> + +#include "MEM_guardedalloc.h" + +#include "GPU_draw.h" +#include "GPU_matrix.h" +#include "GPU_batch.h" +#include "GPU_immediate.h" +#include "GPU_state.h" + +#include "BLI_blenlib.h" +#include "BLI_utildefines.h" +#include "BLI_fileops_types.h" +#include "BLI_math_vector.h" + +#include "DNA_brush_types.h" +#include "DNA_curve_types.h" +#include "DNA_dynamicpaint_types.h" +#include "DNA_object_types.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_workspace_types.h" + +#include "RNA_access.h" +#include "RNA_enum_types.h" + +#include "BKE_context.h" +#include "BKE_global.h" +#include "BKE_icons.h" +#include "BKE_appdir.h" +#include "BKE_studiolight.h" + +#include "IMB_imbuf.h" +#include "IMB_imbuf_types.h" +#include "IMB_thumbs.h" + +#include "BIF_glutil.h" +#include "BLF_api.h" + +#include "DEG_depsgraph.h" + +#include "DRW_engine.h" + +#include "ED_datafiles.h" +#include "ED_keyframes_draw.h" +#include "ED_render.h" + +#include "UI_interface.h" +#include "UI_interface_icons.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "interface_intern.h" + +static void icon_draw_rect_input_small_text_ex( + const rctf *rect, const float color[4], const float margin[2], const char *str, + int font_size) +{ + BLF_batch_draw_flush(); + const int font_id = BLF_default(); + BLF_color4fv(font_id, color); + BLF_size(font_id, font_size * U.pixelsize, U.dpi); + BLF_position(font_id, rect->xmin + margin[0] * 2, rect->ymin + margin[1] * 5, 0.0f); + BLF_draw(font_id, str, BLF_DRAW_STR_DUMMY_MAX); + BLF_batch_draw_flush(); +} + +static void icon_draw_rect_input_small_text( + const rctf *rect, const float color[4], const float margin[2], const char *str) +{ + icon_draw_rect_input_small_text_ex(rect, color, margin, str, 8); +} + +static void icon_draw_rect_input_default_text( + const rctf *rect, + const float color[4], const float margin[2], const char *str) +{ + BLF_batch_draw_flush(); + const int font_id = BLF_default(); + BLF_color4fv(font_id, color); + BLF_position(font_id, (int)(rect->xmin + margin[0] * 5), (int)(rect->ymin + margin[1] * 5), 0.0f); + BLF_draw(font_id, str, BLF_DRAW_STR_DUMMY_MAX); + BLF_batch_draw_flush(); +} + +static void icon_draw_rect_input_mono_text( + const rctf *rect, + const float color[4], const float margin[2], const char *str) +{ + BLF_batch_draw_flush(); + const int font_id = blf_mono_font; + BLF_color4fv(font_id, color); + BLF_size(font_id, 20 * U.pixelsize, U.dpi); + BLF_position(font_id, (int)(rect->xmin + margin[0] * 5), (int)(rect->ymin + margin[1] * 5), 0.0f); + BLF_draw(font_id, str, BLF_DRAW_STR_DUMMY_MAX); + BLF_batch_draw_flush(); +} + +static void icon_draw_rect_input_line_prim( + const rctf *rect, + const float color[4], + const int prim, + const char lines[][2], int lines_len) +{ + glEnable(GL_LINE_SMOOTH); + glEnable(GL_BLEND); + BLI_assert(ELEM(prim, GWN_PRIM_LINE_LOOP, GWN_PRIM_LINE_STRIP)); + const uint pos_id = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immUniformColor4fv(color); + immBegin(prim, lines_len); + float w_inv = BLI_rctf_size_x(rect) / 255.0f; + float h_inv = BLI_rctf_size_y(rect) / 255.0f; + for (int i = 0; i < lines_len; i++) { + immVertex2f( + pos_id, + round_fl_to_int(rect->xmin + ((float)lines[i][0] * w_inv)), + round_fl_to_int(rect->ymin + ((float)lines[i][1] * h_inv)) + ); + } + immEnd(); + immUnbindProgram(); + glDisable(GL_LINE_SMOOTH); + glDisable(GL_BLEND); +} + +void icon_draw_rect_input( + float x, float y, int w, int h, float UNUSED(alpha), + short event_type, short UNUSED(event_value)) +{ + float color[4]; + const float margin[2] = {w / 20.0f, h / 20.0f}; + UI_GetThemeColor4fv(TH_TEXT, color); + UI_draw_roundbox_corner_set(UI_CNR_ALL); + UI_draw_roundbox_aa( + false, + (int)x, + (int)y, + (int)(x + w), + (int)(y + h), 4.0f, color + ); + + const rctf rect = { + .xmin = x, + .ymin = y, + .xmax = x + w, + .ymax = y + h, + }; + + const bool simple_text = false; + + if ((event_type >= AKEY) || (ZKEY <= event_type)) { + char str[2] = {'A' + (event_type - AKEY), '\0'}; + icon_draw_rect_input_default_text(&rect, color, margin, str); + } + if ((event_type >= F1KEY) || (F12KEY <= event_type)) { + char str[3] = {'F', '1' + (event_type - F1KEY), '\0'}; + icon_draw_rect_input_default_text(&rect, color, margin, str); + } + else if (event_type == LEFTSHIFTKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Shift"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -14.0f), (w / -14.0f)); + icon_draw_rect_input_mono_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x87, 0xa7, 0x0}); + } + } + else if (event_type == LEFTCTRLKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Ctrl"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -16.0f), 0.0f); + icon_draw_rect_input_default_text(&rect_ofs, color, margin, "^"); + } + } + else if (event_type == LEFTALTKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Alt"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -8.0f), 0.0f); + icon_draw_rect_input_default_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x8c, 0xa5, 0x0}); + } + } + else if (event_type == OSKEY) { + icon_draw_rect_input_small_text(&rect, color, margin, "OS"); + } + else if (event_type == DELKEY) { + icon_draw_rect_input_small_text(&rect, color, margin, "Del"); + } + else if (event_type == TABKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Tab"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -12.0f), (w / -12.0f)); + icon_draw_rect_input_mono_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x86, 0xb9, 0x0}); + } + } + else if (event_type == HOMEKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Home"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -12.0f), (w / -12.0f)); + icon_draw_rect_input_mono_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x87, 0xa4, 0x0}); + } + } + else if (event_type == ENDKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "End"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -12.0f), (w / -12.0f)); + icon_draw_rect_input_mono_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x87, 0xa5, 0x0}); + } + } + else if (event_type == RETKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Ret"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -8.0f), (w / -6.0f)); + icon_draw_rect_input_mono_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x8f, 0x8e, 0x0}); + } + } + else if (event_type == ESCKEY) { + icon_draw_rect_input_small_text(&rect, color, margin, "Esc"); + } + else if (event_type == PAGEUPKEY) { + icon_draw_rect_input_small_text_ex(&rect, color, margin, (const char[]){'P', 0xe2, 0x86, 0x91, 0x0}, 10); + } + else if (event_type == PAGEDOWNKEY) { + icon_draw_rect_input_small_text_ex(&rect, color, margin, (const char[]){'P', 0xe2, 0x86, 0x93, 0x0}, 10); + } + else if (event_type == LEFTARROWKEY) { + icon_draw_rect_input_default_text(&rect, color, margin, (const char[]){0xe2, 0x86, 0x90, 0x0}); + } + else if (event_type == UPARROWKEY) { + icon_draw_rect_input_default_text(&rect, color, margin, (const char[]){0xe2, 0x86, 0x91, 0x0}); + } + else if (event_type == RIGHTARROWKEY) { + icon_draw_rect_input_default_text(&rect, color, margin, (const char[]){0xe2, 0x86, 0x92, 0x0}); + } + else if (event_type == DOWNARROWKEY) { + icon_draw_rect_input_default_text(&rect, color, margin, (const char[]){0xe2, 0x86, 0x93, 0x0}); + } + else if (event_type == SPACEKEY) { + const uchar lines[] = {60, 118, 60, 60, 195, 60, 195, 118}; + icon_draw_rect_input_line_prim( + &rect, color, GWN_PRIM_LINE_STRIP, + (const void *)lines, ARRAY_SIZE(lines) / 2); + } +} diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 04e9e2b18b4..ffc389c6dfd 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -105,7 +105,8 @@ typedef enum { UI_WTYPE_PROGRESSBAR, } uiWidgetTypeEnum; -#define UI_MENU_WIDTH_MIN (UI_UNIT_Y * 9) +#define UI_MENU_WIDTH_MIN (UI_UNIT_Y * 9) +#define UI_MENU_SUBMENU_PADDING (6 * UI_DPI_FAC) /* some extra padding added to menus containing submenu icons */ /* menu scrolling */ #define UI_MENU_SCROLL_ARROW 12 @@ -349,6 +350,13 @@ struct PieMenuData { float alphafac; }; +/* uiBlock.content_hints */ +enum eBlockContentHints { + /* In a menu block, if there is a single sub-menu button, we add some + * padding to the right to put nicely aligned triangle icons there. */ + BLOCK_CONTAINS_SUBMENU_BUT = (1 << 0), +}; + struct uiBlock { uiBlock *next, *prev; @@ -395,11 +403,15 @@ struct uiBlock { int flag; short alignnr; + /* Hints about the buttons of this block. Used to avoid iterating over + * buttons to find out if some criteria is met by any. Instead, check this + * criteria when adding the button and set a flag here if it's met. */ + short content_hints; /* eBlockContentHints */ char direction; char dt; /* drawtype: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied to buttons */ bool auto_open; - char _pad[7]; + char _pad[5]; double auto_open_last; const char *lockstr; @@ -744,8 +756,7 @@ struct Gwn_Batch *ui_batch_roundbox_get(bool filled, bool antialiased); struct Gwn_Batch *ui_batch_roundbox_widget_get(int tria); struct Gwn_Batch *ui_batch_roundbox_shadow_get(void); -void ui_draw_anti_roundbox(int mode, float minx, float miny, float maxx, float maxy, - float rad, bool use_alpha, const float color[4]); +void ui_draw_anti_tria_rect(const rctf *rect, char dir, const float color[4]); void ui_draw_menu_back(struct uiStyle *style, uiBlock *block, rcti *rect); void ui_draw_popover_back(ARegion *ar, struct uiStyle *style, uiBlock *block, rcti *rect); void ui_draw_pie_center(uiBlock *block); @@ -778,6 +789,11 @@ void uiStyleInit(void); void ui_icon_ensure_deferred(const struct bContext *C, const int icon_id, const bool big); int ui_id_icon_get(const struct bContext *C, struct ID *id, const bool big); +/* interface_icons_event.c */ +void icon_draw_rect_input( + float x, float y, int w, int h, float alpha, + short event_type, short event_value); + /* resources.c */ void init_userdef_do_versions(struct Main *bmain); void ui_theme_init_default(void); diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index a99a6610e88..27afdcdd202 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -469,23 +469,6 @@ void UI_draw_icon_tri(float x, float y, char dir, const float color[4]) } } -/* triangle 'icon' inside rect */ -static void ui_draw_tria_rect(const rctf *rect, char dir) -{ - float color[4]; - UI_GetThemeColor3fv(TH_TITLE, color); - color[3] = 1.0f; - - if (dir == 'h') { - float half = 0.5f * BLI_rctf_size_y(rect); - UI_draw_anti_tria(rect->xmin, rect->ymin, rect->xmin, rect->ymax, rect->xmax, rect->ymin + half, color); - } - else { - float half = 0.5f * BLI_rctf_size_x(rect); - UI_draw_anti_tria(rect->xmin, rect->ymax, rect->xmax, rect->ymax, rect->xmin + half, rect->ymin, color); - } -} - static void ui_draw_anti_x(unsigned int pos, float x1, float y1, float x2, float y2) { @@ -695,7 +678,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, const rcti *rect, con titlerect.xmin += 5.0f / block->aspect; } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); if (!is_subpanel) { @@ -708,7 +691,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, const rcti *rect, con if (UI_GetThemeValue(TH_PANEL_SHOW_HEADER)) { /* draw with background color */ immUniformThemeColor(TH_PANEL_HEADER); - immRectf(pos, minx, headrect.ymin + 1, maxx, y); + immRectf(pos, minx, headrect.ymin, maxx, y); immBegin(GWN_PRIM_LINES, 4); @@ -770,7 +753,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, const rcti *rect, con ui_draw_aligned_panel_header(style, block, &titlerect, 'h'); if (show_drag) { - unsigned int col; + uint col; Gwn_VertFormat *format = immVertexFormat(); pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); @@ -853,12 +836,18 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, const rcti *rect, con BLI_rctf_scale(&itemrect, 0.25f); - if (is_closed_y) - ui_draw_tria_rect(&itemrect, 'h'); - else if (is_closed_x) - ui_draw_tria_rect(&itemrect, 'h'); - else - ui_draw_tria_rect(&itemrect, 'v'); + { + float tria_color[4]; + UI_GetThemeColor3fv(TH_TITLE, tria_color); + tria_color[3] = 1.0f; + + if (is_closed_y) + ui_draw_anti_tria_rect(&itemrect, 'h', tria_color); + else if (is_closed_x) + ui_draw_anti_tria_rect(&itemrect, 'h', tria_color); + else + ui_draw_anti_tria_rect(&itemrect, 'v', tria_color); + } } /************************** panel alignment *************************/ @@ -1741,30 +1730,30 @@ static void ui_panel_category_draw_tab( int a; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); /* mult */ for (a = 0; a < 4; a++) { mul_v2_fl(vec[a], rad); } - unsigned int vert_ct = 0; + uint vert_len = 0; if (use_highlight) { - vert_ct += (roundboxtype & UI_CNR_TOP_RIGHT) ? 6 : 1; - vert_ct += (roundboxtype & UI_CNR_TOP_LEFT) ? 6 : 1; + vert_len += (roundboxtype & UI_CNR_TOP_RIGHT) ? 6 : 1; + vert_len += (roundboxtype & UI_CNR_TOP_LEFT) ? 6 : 1; } if (use_highlight && !use_shadow) { - vert_ct++; + vert_len++; } else { - vert_ct += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 6 : 1; - vert_ct += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 6 : 1; + vert_len += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 6 : 1; + vert_len += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 6 : 1; } immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); - immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_STRIP, vert_ct); + immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_STRIP, vert_len); /* start with corner right-top */ if (use_highlight) { @@ -1969,7 +1958,7 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active) /* begin drawing */ GPU_line_smooth(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* draw the background */ diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c index 320ee1f4616..1bbf2242c5d 100644 --- a/source/blender/editors/interface/interface_region_popup.c +++ b/source/blender/editors/interface/interface_region_popup.c @@ -116,6 +116,9 @@ static void ui_popup_block_position(wmWindow *window, ARegion *butregion, uiBut BLI_rctf_init_minmax(&block->rect); for (uiBut *bt = block->buttons.first; bt; bt = bt->next) { + if (block->content_hints & BLOCK_CONTAINS_SUBMENU_BUT) { + bt->rect.xmax += UI_MENU_SUBMENU_PADDING; + } BLI_rctf_union(&block->rect, &bt->rect); } } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 1c3ed3e3c75..f80e4e486d6 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -518,7 +518,7 @@ static const char *template_id_browse_tip(const StructRNA *type) case ID_IM: return N_("Browse Image to be linked"); case ID_LS: return N_("Browse Line Style Data to be linked"); case ID_LT: return N_("Browse Lattice Data to be linked"); - case ID_LA: return N_("Browse Lamp Data to be linked"); + case ID_LA: return N_("Browse Light Data to be linked"); case ID_CA: return N_("Browse Camera Data to be linked"); case ID_WO: return N_("Browse World Settings to be linked"); case ID_SCR: return N_("Choose Screen layout"); @@ -1863,7 +1863,7 @@ void uiTemplatePreview( char _preview_id[UI_MAX_NAME_STR]; if (id && !ELEM(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA, ID_LS)) { - RNA_warning("Expected ID of type material, texture, lamp, world or line style"); + RNA_warning("Expected ID of type material, texture, light, world or line style"); return; } @@ -1954,7 +1954,7 @@ void uiTemplatePreview( pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); } else if (GS(parent->name) == ID_LA) { - uiDefButS(block, UI_BTYPE_ROW, B_MATPRV, IFACE_("Lamp"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, + uiDefButS(block, UI_BTYPE_ROW, B_MATPRV, IFACE_("Light"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); } else if (GS(parent->name) == ID_WO) { diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index c390c3fdda8..03ff6593c59 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -259,7 +259,7 @@ static struct { static Gwn_VertFormat *vflag_format(void) { - if (g_ui_batch_cache.format.attrib_ct == 0) { + if (g_ui_batch_cache.format.attr_len == 0) { Gwn_VertFormat *format = &g_ui_batch_cache.format; g_ui_batch_cache.vflag_id = GWN_vertformat_attr_add(format, "vflag", GWN_COMP_U32, 1, GWN_FETCH_INT); } @@ -512,7 +512,7 @@ void UI_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(draw_color); @@ -532,6 +532,20 @@ void UI_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y GPU_blend(false); } +/* triangle 'icon' inside rect */ +void ui_draw_anti_tria_rect(const rctf *rect, char dir, const float color[4]) +{ + if (dir == 'h') { + float half = 0.5f * BLI_rctf_size_y(rect); + UI_draw_anti_tria(rect->xmin, rect->ymin, rect->xmin, rect->ymax, rect->xmax, rect->ymin + half, color); + } + else { + float half = 0.5f * BLI_rctf_size_x(rect); + UI_draw_anti_tria(rect->xmin, rect->ymax, rect->xmax, rect->ymax, rect->xmin + half, rect->ymin, color); + } +} + + void UI_draw_anti_fan(float tri_array[][2], unsigned int length, const float color[4]) { float draw_color[4]; @@ -541,7 +555,7 @@ void UI_draw_anti_fan(float tri_array[][2], unsigned int length, const float col GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(draw_color); @@ -1255,8 +1269,8 @@ static int ui_but_draw_menu_icon(const uiBut *but) /* icons have been standardized... and this call draws in untransformed coordinates */ static void widget_draw_icon_ex( - const uiBut *but, BIFIconID icon, float alpha, const rcti *rect, const bool show_menu_icon, - const int icon_size) + const uiBut *but, BIFIconID icon, float alpha, + const rcti *rect, const int icon_size) { float xs = 0.0f, ys = 0.0f; float aspect, height; @@ -1331,20 +1345,35 @@ static void widget_draw_icon_ex( } } - if (show_menu_icon) { - xs = rect->xmax - UI_DPI_ICON_SIZE - aspect; - ys = (rect->ymin + rect->ymax - height) / 2.0f; - - UI_icon_draw_aspect(xs, ys, ICON_RIGHTARROW_THIN, aspect, alpha); - } - GPU_blend(false); } static void widget_draw_icon( - const uiBut *but, BIFIconID icon, float alpha, const rcti *rect, const bool show_menu_icon) + const uiBut *but, BIFIconID icon, float alpha, const rcti *rect) +{ + widget_draw_icon_ex(but, icon, alpha, rect, ICON_DEFAULT_HEIGHT); +} + +static void widget_draw_submenu_tria(const uiBut *but, const rcti *rect, const uiWidgetColors *wcol) { - widget_draw_icon_ex(but, icon, alpha, rect, show_menu_icon, ICON_DEFAULT_HEIGHT); + const float aspect = but->block->aspect / UI_DPI_FAC; + const int tria_height = (int)(ICON_DEFAULT_HEIGHT / aspect); + const int tria_width = (int)(ICON_DEFAULT_WIDTH / aspect) - 2 * U.pixelsize; + const int xs = rect->xmax - tria_width; + const int ys = (rect->ymin + rect->ymax - tria_height) / 2.0f; + float col[4]; + rctf tria_rect; + + rgba_uchar_to_float(col, (const uchar *)wcol->text); + col[3] *= 0.8f; + + BLI_rctf_init(&tria_rect, xs, xs + tria_width, ys, ys + tria_height); + BLI_rctf_scale(&tria_rect, 0.4f); + + GPU_blend(true); + UI_widgetbase_draw_cache_flush(); + GPU_blend(false); + ui_draw_anti_tria_rect(&tria_rect, 'h', col); } static void ui_text_clip_give_prev_off(uiBut *but, const char *str) @@ -1806,7 +1835,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b selwidth_draw = BLF_width(fstyle->uifont_id, drawstr + but->ofs, but->selend - but->ofs); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv((unsigned char *)wcol->item); @@ -1842,7 +1871,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b UI_widgetbase_draw_cache_flush(); GPU_blend(false); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3f(0.2f, 0.6f, 0.9f); @@ -1987,7 +2016,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB if (ELEM(but->type, UI_BTYPE_MENU, UI_BTYPE_POPOVER) && (but->flag & UI_BUT_NODE_LINK)) { rcti temp = *rect; temp.xmin = rect->xmax - BLI_rcti_size_y(rect) - 1; - widget_draw_icon(but, ICON_LAYER_USED, alpha, &temp, false); + widget_draw_icon(but, ICON_LAYER_USED, alpha, &temp); rect->xmax = temp.xmin; } @@ -2057,17 +2086,17 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB else if (ui_block_is_menu(but->block)) rect->xmin += 0.3f * U.widget_unit; - widget_draw_icon(but, icon, alpha, rect, show_menu_icon); + widget_draw_icon(but, icon, alpha, rect); + if (show_menu_icon) { + BLI_assert(but->block->content_hints & BLOCK_CONTAINS_SUBMENU_BUT); + widget_draw_submenu_tria(but, rect, wcol); + } #ifdef USE_UI_TOOLBAR_HACK but->block->aspect = aspect_orig; #endif rect->xmin += icon_size; - /* without this menu keybindings will overlap the arrow icon [#38083] */ - if (show_menu_icon) { - rect->xmax -= icon_size / 2.0f; - } } if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT)) { @@ -2077,6 +2106,12 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB rect->xmax -= (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect; } + /* Menu contains sub-menu items with triangle icon on their right. Shortcut + * strings should be drawn with some padding to the right then. */ + if (ui_block_is_menu(but->block) && (but->block->content_hints & BLOCK_CONTAINS_SUBMENU_BUT)) { + rect->xmax -= UI_MENU_SUBMENU_PADDING; + } + /* extra icons, e.g. 'x' icon to clear text or icon for eyedropper */ if (extra_icon_type != UI_BUT_ICONEXTRA_NONE) { rcti temp = *rect; @@ -2084,10 +2119,10 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f); if (extra_icon_type == UI_BUT_ICONEXTRA_CLEAR) { - widget_draw_icon(but, ICON_PANEL_CLOSE, alpha, &temp, false); + widget_draw_icon(but, ICON_PANEL_CLOSE, alpha, &temp); } else if (extra_icon_type == UI_BUT_ICONEXTRA_EYEDROPPER) { - widget_draw_icon(but, ICON_EYEDROPPER, alpha, &temp, false); + widget_draw_icon(but, ICON_EYEDROPPER, alpha, &temp); } else { BLI_assert(0); @@ -2387,7 +2422,7 @@ static void widget_softshadow(const rcti *rect, int roundboxalign, const float r /* we draw a number of increasing size alpha quad strips */ alphastep = 3.0f * btheme->tui.menu_shadow_fac / radout; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -2439,7 +2474,7 @@ static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int dir static void ui_hsv_cursor(float x, float y) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -2536,8 +2571,8 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti * ui_color_picker_to_rgb(0.0f, 0.0f, hsv[2], colcent, colcent + 1, colcent + 2); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); @@ -2647,8 +2682,8 @@ void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, cons /* old below */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); immBegin(GWN_PRIM_TRIS, steps * 3 * 6); @@ -2807,7 +2842,7 @@ static void ui_draw_but_HSVCUBE(uiBut *but, const rcti *rect) ui_hsv_cursor(x, y); /* outline */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ub(0, 0, 0); imm_draw_box_wire_2d(pos, (rect->xmin), (rect->ymin), (rect->xmax), (rect->ymax)); @@ -2904,7 +2939,7 @@ static void ui_draw_separator(const rcti *rect, uiWidgetColors *wcol) 30 }; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_blend(true); @@ -3366,7 +3401,7 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat UI_widgetbase_draw_cache_flush(); GPU_blend(false); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3f(bw, bw, bw); @@ -3747,7 +3782,7 @@ static void widget_draw_extra_mask(const bContext *C, uiBut *but, uiWidgetType * /* note: drawextra can change rect +1 or -1, to match round errors of existing previews */ but->block->drawextra(C, but->poin, but->block->drawextra_arg1, but->block->drawextra_arg2, rect); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* make mask to draw over image */ @@ -4384,7 +4419,7 @@ static void ui_draw_popover_back_impl( /* Draw popover arrow (top/bottom) */ if (ELEM(direction, UI_DIR_UP, UI_DIR_DOWN)) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv((unsigned char *)wcol->inner); GPU_blend(true); @@ -4521,7 +4556,7 @@ void ui_draw_pie_center(uiBlock *block) } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv((unsigned char *)btheme->tui.wcol_pie_menu.outline); diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index fc282e50ce2..bf768f26a93 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1340,8 +1340,8 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag) return; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); immBegin(GWN_PRIM_LINES, vertex_count); @@ -1482,8 +1482,8 @@ void UI_view2d_constant_grid_draw(View2D *v2d, float step) if (count_x > 0 || count_y > 0) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); float theme_color[3]; UI_GetThemeColorShade3fv(TH_BACK, -10, theme_color); @@ -1533,8 +1533,8 @@ void UI_view2d_multi_grid_draw(View2D *v2d, int colorid, float step, int level_s vertex_count += 2 * ((int)((v2d->cur.ymax - v2d->cur.ymin) / lstep) + 1); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); GPU_line_width(1.0f); diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 6b5fce26deb..4717ef309f3 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -125,7 +125,7 @@ static void draw_single_handle(const MaskLayer *mask_layer, const MaskSplinePoin } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); const unsigned char rgb_gray[4] = {0x60, 0x60, 0x60, 0xff}; immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -213,7 +213,7 @@ static void draw_spline_points(const bContext *C, MaskLayer *masklay, MaskSpline mask_spline_color_get(masklay, spline, is_spline_sel, rgb_spline); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); immUniform1f("size", 0.7f * handle_size); @@ -371,10 +371,10 @@ static void mask_color_active_tint(unsigned char r_rgb[4], const unsigned char r } } -static void mask_draw_array(unsigned int pos, Gwn_PrimType prim_type, const float (*points)[2], unsigned int vertex_ct) +static void mask_draw_array(unsigned int pos, Gwn_PrimType prim_type, const float (*points)[2], unsigned int vertex_len) { - immBegin(prim_type, vertex_ct); - for (unsigned int i = 0; i < vertex_ct; ++i) { + immBegin(prim_type, vertex_len); + for (unsigned int i = 0; i < vertex_len; ++i) { immVertex2fv(pos, points[i]); } immEnd(); @@ -403,7 +403,7 @@ static void mask_draw_curve_type(const bContext *C, MaskSpline *spline, float (* } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); switch (draw_type) { @@ -747,7 +747,7 @@ void ED_mask_draw_frames(Mask *mask, ARegion *ar, const int cfra, const int sfra unsigned int num_lines = BLI_listbase_count(&masklay->splines_shapes); if (num_lines > 0) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ub(255, 175, 0, 255); diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 8f8400e2d20..8a9a5eadbdd 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1007,7 +1007,7 @@ static void knifetool_draw_angle_snapping(const KnifeTool_OpData *kcd) copy_v3_v3(v2, ray_hit_best[1]); } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformThemeColor(TH_TRANSFORM); @@ -1048,7 +1048,7 @@ static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void gpuPushMatrix(); gpuMultMatrix(kcd->ob->obmat); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index b437bdca111..87c006095ed 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -116,7 +116,7 @@ static void ringsel_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *a gpuPushMatrix(); gpuMultMatrix(lcd->ob->obmat); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor3ub(255, 0, 255); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index a8c3c905dd4..a8917f4c4aa 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -120,12 +120,12 @@ /* this is an exact copy of the define in rna_lamp.c * kept here because of linking order. * Icons are only defined here */ -const EnumPropertyItem rna_enum_lamp_type_items[] = { - {LA_LOCAL, "POINT", ICON_LAMP_POINT, "Point", "Omnidirectional point light source"}, - {LA_SUN, "SUN", ICON_LAMP_SUN, "Sun", "Constant direction parallel ray light source"}, - {LA_SPOT, "SPOT", ICON_LAMP_SPOT, "Spot", "Directional cone light source"}, - {LA_HEMI, "HEMI", ICON_LAMP_HEMI, "Hemi", "180 degree constant light source"}, - {LA_AREA, "AREA", ICON_LAMP_AREA, "Area", "Directional area light source"}, +const EnumPropertyItem rna_enum_light_type_items[] = { + {LA_LOCAL, "POINT", ICON_LIGHT_POINT, "Point", "Omnidirectional point light source"}, + {LA_SUN, "SUN", ICON_LIGHT_SUN, "Sun", "Constant direction parallel ray light source"}, + {LA_SPOT, "SPOT", ICON_LIGHT_SPOT, "Spot", "Directional cone light source"}, + {LA_HEMI, "HEMI", ICON_LIGHT_HEMI, "Hemi", "180 degree constant light source"}, + {LA_AREA, "AREA", ICON_LIGHT_AREA, "Area", "Directional area light source"}, {0, NULL, 0, NULL, NULL} }; @@ -985,9 +985,9 @@ void OBJECT_OT_drop_named_image(wmOperatorType *ot) ED_object_add_generic_props(ot, false); } -/********************* Add Lamp Operator ********************/ +/********************* Add Light Operator ********************/ -static const char *get_lamp_defname(int type) +static const char *get_light_defname(int type) { switch (type) { case LA_LOCAL: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Point"); @@ -996,11 +996,11 @@ static const char *get_lamp_defname(int type) case LA_HEMI: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Hemi"); case LA_AREA: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Area"); default: - return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Lamp"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Light"); } } -static int object_lamp_add_exec(bContext *C, wmOperator *op) +static int object_light_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *ob; @@ -1013,10 +1013,10 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op) if (!ED_object_add_generic_get_opts(C, op, 'Z', loc, rot, NULL, &layer, NULL)) return OPERATOR_CANCELLED; - ob = ED_object_add_type(C, OB_LAMP, get_lamp_defname(type), loc, rot, false, layer); + ob = ED_object_add_type(C, OB_LAMP, get_light_defname(type), loc, rot, false, layer); float size = RNA_float_get(op->ptr, "radius"); - /* Better defaults for lamp size. */ + /* Better defaults for light size. */ switch (type) { case LA_LOCAL: case LA_SPOT: @@ -1041,23 +1041,23 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void OBJECT_OT_lamp_add(wmOperatorType *ot) +void OBJECT_OT_light_add(wmOperatorType *ot) { /* identifiers */ - ot->name = "Add Lamp"; - ot->description = "Add a lamp object to the scene"; - ot->idname = "OBJECT_OT_lamp_add"; + ot->name = "Add Light"; + ot->description = "Add a light object to the scene"; + ot->idname = "OBJECT_OT_light_add"; /* api callbacks */ ot->invoke = WM_menu_invoke; - ot->exec = object_lamp_add_exec; + ot->exec = object_light_add_exec; ot->poll = ED_operator_objectmode; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_lamp_type_items, 0, "Type", ""); + ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_light_type_items, 0, "Type", ""); RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_LAMP); ED_object_add_unit_props(ot); diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index b1ea6d72346..1b5c6df2632 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -115,7 +115,7 @@ void OBJECT_OT_armature_add(struct wmOperatorType *ot); void OBJECT_OT_empty_add(struct wmOperatorType *ot); void OBJECT_OT_lightprobe_add(struct wmOperatorType *ot); void OBJECT_OT_drop_named_image(struct wmOperatorType *ot); -void OBJECT_OT_lamp_add(struct wmOperatorType *ot); +void OBJECT_OT_light_add(struct wmOperatorType *ot); void OBJECT_OT_effector_add(struct wmOperatorType *ot); void OBJECT_OT_camera_add(struct wmOperatorType *ot); void OBJECT_OT_speaker_add(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 43d993531bc..5a83d085aee 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -114,7 +114,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_empty_add); WM_operatortype_append(OBJECT_OT_lightprobe_add); WM_operatortype_append(OBJECT_OT_drop_named_image); - WM_operatortype_append(OBJECT_OT_lamp_add); + WM_operatortype_append(OBJECT_OT_light_add); WM_operatortype_append(OBJECT_OT_camera_add); WM_operatortype_append(OBJECT_OT_speaker_add); WM_operatortype_append(OBJECT_OT_add); diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index b1dee812f45..d5f7a93cc6e 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -485,7 +485,7 @@ enum { OBJECT_GRPSEL_PASS = 8, OBJECT_GRPSEL_COLOR = 9, OBJECT_GRPSEL_KEYINGSET = 10, - OBJECT_GRPSEL_LAMP_TYPE = 11, + OBJECT_GRPSEL_LIGHT_TYPE = 11, }; static const EnumPropertyItem prop_select_grouped_types[] = { @@ -499,7 +499,7 @@ static const EnumPropertyItem prop_select_grouped_types[] = { {OBJECT_GRPSEL_PASS, "PASS", 0, "Pass", "Render pass Index"}, {OBJECT_GRPSEL_COLOR, "COLOR", 0, "Color", "Object Color"}, {OBJECT_GRPSEL_KEYINGSET, "KEYINGSET", 0, "Keying Set", "Objects included in active Keying Set"}, - {OBJECT_GRPSEL_LAMP_TYPE, "LAMP_TYPE", 0, "Lamp Type", "Matching lamp types"}, + {OBJECT_GRPSEL_LIGHT_TYPE, "LIGHT_TYPE", 0, "Light Type", "Matching light types"}, {0, NULL, 0, NULL, NULL} }; @@ -803,9 +803,9 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op) case OBJECT_GRPSEL_KEYINGSET: changed |= select_grouped_keyingset(C, ob, op->reports); break; - case OBJECT_GRPSEL_LAMP_TYPE: + case OBJECT_GRPSEL_LIGHT_TYPE: if (ob->type != OB_LAMP) { - BKE_report(op->reports, RPT_ERROR, "Active object must be a lamp"); + BKE_report(op->reports, RPT_ERROR, "Active object must be a light"); break; } changed |= select_grouped_lamptype(C, ob); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 721d248ae4c..d2a0879464b 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -485,7 +485,7 @@ static int apply_objects_internal( if (la->type == LA_AREA) { if (apply_rot || apply_loc) { BKE_reportf(reports, RPT_ERROR, - "Area Lamps can only have scale applied: \"%s\"", + "Area Lights can only have scale applied: \"%s\"", ob->id.name + 2); changed = false; } @@ -1540,8 +1540,8 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const void OBJECT_OT_transform_axis_target(wmOperatorType *ot) { /* identifiers */ - ot->name = "Interactive Lamp Track to Cursor"; - ot->description = "Interactively point cameras and lamps to a location (Ctrl translates)"; + ot->name = "Interactive Light Track to Cursor"; + ot->description = "Interactively point cameras and lights to a location (Ctrl translates)"; ot->idname = "OBJECT_OT_transform_axis_target"; /* api callbacks */ diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index a08e35d08a7..10d9c90aeb3 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -2892,7 +2892,7 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata) brush = &pset->brush[pset->brushtype]; if (brush) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ub(255, 255, 255, 128); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index ae364828119..d6a968d993c 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -427,7 +427,7 @@ static void make_renderinfo_string(const RenderStats *rs, if (rs->totface) spos += sprintf(spos, IFACE_("Fa:%d "), rs->totface); if (rs->tothalo) spos += sprintf(spos, IFACE_("Ha:%d "), rs->tothalo); if (rs->totstrand) spos += sprintf(spos, IFACE_("St:%d "), rs->totstrand); - if (rs->totlamp) spos += sprintf(spos, IFACE_("La:%d "), rs->totlamp); + if (rs->totlamp) spos += sprintf(spos, IFACE_("Li:%d "), rs->totlamp); if (rs->mem_peak == 0.0f) spos += sprintf(spos, IFACE_("| Mem:%.2fM (%.2fM, Peak %.2fM) "), diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 19f30ac59aa..886b3112aad 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1836,7 +1836,7 @@ static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op)) if (id == NULL) { Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data; - Lamp *la = CTX_data_pointer_get_type(C, "lamp", &RNA_Lamp).data; + Lamp *la = CTX_data_pointer_get_type(C, "light", &RNA_Light).data; World *wo = CTX_data_pointer_get_type(C, "world", &RNA_World).data; ParticleSystem *psys = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem).data; FreestyleLineStyle *linestyle = CTX_data_pointer_get_type(C, "line_style", &RNA_FreestyleLineStyle).data; diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 77e178bf0b2..137fd01a146 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -106,7 +106,7 @@ static void region_draw_emboss(const ARegion *ar, const rcti *scirct, int sides) UI_GetThemeColor3fv(TH_EDITOR_OUTLINE, color); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(color); @@ -263,7 +263,7 @@ static void area_draw_azone_fullscreen(short x1, short y1, short x2, short y2, f BLI_rcti_init(&click_rect, x, x + icon_size, y, y + icon_size); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -296,7 +296,7 @@ static void draw_azone_plus(float x1, float y1, float x2, float y2) float pad = 0.2f * U.widget_unit; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); GPU_blend(true); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -501,7 +501,7 @@ void ED_region_do_draw(bContext *C, ARegion *ar) #if 0 GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4f(drand48(), drand48(), drand48(), 0.1f); immRectf(pos, ar->drawrct.xmin - ar->winrct.xmin, ar->drawrct.ymin - ar->winrct.ymin, @@ -2473,7 +2473,7 @@ void ED_region_info_draw_multiline(ARegion *ar, const char *text_array[], float GPU_blend(true); GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(fill_color); immRecti(pos, rect.xmin, rect.ymin, rect.xmax + 1, rect.ymax + 1); @@ -2692,7 +2692,7 @@ void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, const rctf *frame, BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymax, frame->ymax + box_y); /* draw top box */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_METADATA_BG); immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax); @@ -2717,7 +2717,7 @@ void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, const rctf *frame, BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymin - box_y, frame->ymin); /* draw top box */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_METADATA_BG); immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax); @@ -2746,7 +2746,7 @@ void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy) UI_view2d_view_to_region(&ar->v2d, 1.0f, 1.0f, &x2, &y2); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShade(TH_BACK, 20); @@ -2877,7 +2877,7 @@ void ED_region_visible_rect(ARegion *ar, rcti *rect) void ED_region_cache_draw_background(const ARegion *ar) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ub(128, 128, 255, 64); immRecti(pos, 0, 0, ar->winx, 8 * UI_DPI_FAC); @@ -2897,7 +2897,7 @@ void ED_region_cache_draw_curfra_label(const int framenr, const float x, const f BLF_width_and_height(fontid, numstr, sizeof(numstr), &font_dims[0], &font_dims[1]); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_CFRAME); immRecti(pos, x, y, x + font_dims[0] + 6.0f, y + font_dims[1] + 4.0f); @@ -2911,7 +2911,7 @@ void ED_region_cache_draw_curfra_label(const int framenr, const float x, const f void ED_region_cache_draw_cached_segments(const ARegion *ar, const int num_segments, const int *points, const int sfra, const int efra) { if (num_segments) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ub(128, 128, 255, 128); diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c index b5b0d16f6a7..9c46938a90f 100644 --- a/source/blender/editors/screen/screen_draw.c +++ b/source/blender/editors/screen/screen_draw.c @@ -323,7 +323,7 @@ static void drawscredge_corner(ScrArea *sa, int sizex, int sizey) /* Wrap up the corners with a nice embossing. */ rcti rect = sa->totrct; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(color); @@ -439,7 +439,7 @@ void ED_screen_draw_edges(wmWindow *win) ScrArea *sa; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* Note: first loop only draws if U.pixelsize > 1, skip otherwise */ @@ -477,7 +477,7 @@ void ED_screen_draw_edges(wmWindow *win) */ void ED_screen_draw_join_shape(ScrArea *sa1, ScrArea *sa2) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_line_width(1); @@ -518,7 +518,7 @@ void ED_screen_draw_join_shape(ScrArea *sa1, ScrArea *sa2) void ED_screen_draw_split_preview(ScrArea *sa, const int dir, const float fac) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* splitpoint */ @@ -594,7 +594,7 @@ static void screen_preview_draw_areas(const bScreen *screen, const float scale[2 const float ofs_between_areas) { const float ofs_h = ofs_between_areas * 0.5f; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(col); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 4a8ab724c9a..381a20feca4 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4888,9 +4888,11 @@ void ED_keymap_screen(wmKeyConfig *keyconf) /* tests */ WM_keymap_add_item(keymap, "SCREEN_OT_region_quadview", QKEY, KM_PRESS, KM_CTRL | KM_ALT, 0); + + WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_SHIFT, 0); + #ifdef USE_WM_KEYMAP_27X WM_keymap_verify_item(keymap, "SCREEN_OT_repeat_history", RKEY, KM_PRESS, KM_CTRL | KM_ALT, 0); - WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_verify_item(keymap, "SCREEN_OT_region_flip", F5KEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "SCREEN_OT_redo_last", F6KEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "SCRIPT_OT_reload", F8KEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 815bcd8a050..6b3c358d2ac 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -681,8 +681,8 @@ static void paint_draw_tex_overlay( /* set quad color. Colored overlay does not get blending */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); if (col) { immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); @@ -770,8 +770,8 @@ static void paint_draw_cursor_overlay( } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); @@ -930,7 +930,7 @@ static void paint_draw_curve_cursor(Brush *brush) GPU_blend(true); /* draw the bezier handles and the curve segment between the current and next point */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1118,7 +1118,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) GPU_blend(true); /* TODO: also set blend mode? */ GPU_line_smooth(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* set brush color */ diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 7f71270c52d..6276a2838f5 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -420,7 +420,7 @@ static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customda GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 8db78a41252..0ef25eb63a1 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -155,7 +155,7 @@ static void paint_draw_smooth_cursor(bContext *C, int x, int y, void *customdata ARegion *ar = stroke->vc.ar; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv(paint->paint_cursor_col); diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index 29b258fc80d..a0ef753e200 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -215,7 +215,7 @@ static void brush_drawcursor_uvsculpt(bContext *C, int x, int y, void *UNUSED(cu alpha *= (size - PX_SIZE_FADE_MIN) / (PX_SIZE_FADE_MAX - PX_SIZE_FADE_MIN); } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3fvAlpha(brush->add_col, alpha); diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 6105652a4c7..8e521c997fd 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -212,7 +212,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) y = (float)(-ACHANNEL_HEIGHT(ac)); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -404,7 +404,7 @@ void timeline_draw_cache(SpaceAction *saction, Object *ob, Scene *scene) BKE_ptcache_ids_from_object(&pidlist, ob, scene, 0); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* iterate over pointcaches on the active object, and draw each one's range */ diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 4c6de3ec012..faee9c2b7ac 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -234,7 +234,7 @@ static int buttons_context_path_data(ButsContextPath *path, int type) else if (RNA_struct_is_a(ptr->type, &RNA_MetaBall) && (type == -1 || type == OB_MBALL)) return 1; else if (RNA_struct_is_a(ptr->type, &RNA_Lattice) && (type == -1 || type == OB_LATTICE)) return 1; else if (RNA_struct_is_a(ptr->type, &RNA_Camera) && (type == -1 || type == OB_CAMERA)) return 1; - else if (RNA_struct_is_a(ptr->type, &RNA_Lamp) && (type == -1 || type == OB_LAMP)) return 1; + else if (RNA_struct_is_a(ptr->type, &RNA_Light) && (type == -1 || type == OB_LAMP)) return 1; else if (RNA_struct_is_a(ptr->type, &RNA_Speaker) && (type == -1 || type == OB_SPEAKER)) return 1; else if (RNA_struct_is_a(ptr->type, &RNA_LightProbe) && (type == -1 || type == OB_LIGHTPROBE)) return 1; /* try to get an object in the path, no pinning supported here */ @@ -679,7 +679,7 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts) const char *buttons_context_dir[] = { "texture_slot", "scene", "world", "object", "mesh", "armature", "lattice", "curve", - "meta_ball", "lamp", "speaker", "lightprobe", "camera", "material", "material_slot", + "meta_ball", "light", "speaker", "lightprobe", "camera", "material", "material_slot", "texture", "texture_user", "texture_user_property", "bone", "edit_bone", "pose_bone", "particle_system", "particle_system_editable", "particle_settings", "cloth", "soft_body", "fluid", "smoke", "collision", "brush", "dynamic_paint", @@ -736,8 +736,8 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r set_pointer_type(path, result, &RNA_MetaBall); return 1; } - else if (CTX_data_equals(member, "lamp")) { - set_pointer_type(path, result, &RNA_Lamp); + else if (CTX_data_equals(member, "light")) { + set_pointer_type(path, result, &RNA_Light); return 1; } else if (CTX_data_equals(member, "camera")) { diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c index d50d10d5cc3..76450cba3cb 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -128,10 +128,10 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) float strip[4], selected_strip[4]; float height = (dopesheet->tot_channel * CHANNEL_STEP) + (CHANNEL_HEIGHT); - unsigned int keyframe_ct = 0; + uint keyframe_len = 0; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* don't use totrect set, as the width stays the same @@ -186,10 +186,10 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) if (start_frame != end_frame) { immRectf(pos_id, start_frame, (float) y - STRIP_HEIGHT_HALF, end_frame, (float) y + STRIP_HEIGHT_HALF); - keyframe_ct += 2; + keyframe_len += 2; } else { - keyframe_ct++; + keyframe_len++; } } @@ -199,7 +199,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) MovieTrackingMarker *marker = &track->markers[i]; if ((marker->flag & (MARKER_DISABLED | MARKER_TRACKED)) == 0) { - keyframe_ct++; + keyframe_len++; } i++; @@ -212,17 +212,17 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) immUnbindProgram(); - if (keyframe_ct > 0) { + if (keyframe_len > 0) { /* draw keyframe markers */ format = immVertexFormat(); pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); - unsigned int outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); GPU_enable_program_point_size(); - immBegin(GWN_PRIM_POINTS, keyframe_ct); + immBegin(GWN_PRIM_POINTS, keyframe_len); /* all same size with black outline */ immAttrib1f(size_id, 2.0f * STRIP_HEIGHT_HALF); @@ -316,7 +316,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar) float y = (float) CHANNEL_FIRST; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 909f0a55c1c..164565192fd 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -167,7 +167,7 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc BKE_movieclip_get_cache_segments(clip, &sc->user, &totseg, &points); ED_region_cache_draw_cached_segments(ar, totseg, points, sfra, efra); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* track */ @@ -290,7 +290,7 @@ static void draw_movieclip_muted(ARegion *ar, int width, int height, float zoomx { int x, y; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* find window pixel coordinates of origin */ @@ -452,7 +452,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin i++; } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1145,8 +1145,8 @@ static void draw_plane_marker_image(Scene *scene, gpuMultMatrix(gl_matrix); Gwn_VertFormat *imm_format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(imm_format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int texCoord = GWN_vertformat_attr_add(imm_format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(imm_format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texCoord = GWN_vertformat_attr_add(imm_format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); immUniformColor4f(1.0f, 1.0f, 1.0f, plane_track->image_opacity); @@ -1414,7 +1414,7 @@ static void draw_tracking_tracks(SpaceClip *sc, Scene *scene, ARegion *ar, Movie } } - unsigned int position = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint position = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1598,7 +1598,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, gpuMultMatrix(sc->stabmat); gpuScale2f(width, height); - unsigned int position = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint position = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index d463f585470..34720b3a627 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -328,7 +328,7 @@ void clip_draw_graph(SpaceClip *sc, ARegion *ar, Scene *scene) UI_view2d_grid_free(grid); if (clip) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_point_size(3.0f); diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c index c3208260b3b..c94853d4233 100644 --- a/source/blender/editors/space_clip/clip_utils.c +++ b/source/blender/editors/space_clip/clip_utils.c @@ -273,7 +273,7 @@ void clip_draw_sfra_efra(View2D *v2d, Scene *scene) GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f); diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index 66b203ff612..0ffbe451042 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -159,7 +159,7 @@ static int console_textview_line_color(struct TextViewContext *tvc, unsigned cha int xy[2] = {CONSOLE_DRAW_MARGIN, CONSOLE_DRAW_MARGIN}; int pen[2]; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); xy[1] += tvc->lheight / 6; console_cursor_wrap_offset(sc->prompt, tvc->console_width, &offl, &offc, NULL); diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 4d4845c41b9..42ad34b659b 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -403,7 +403,7 @@ static void file_draw_preview( /* border */ if (use_dropshadow) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f); @@ -466,7 +466,7 @@ static void draw_background(FileLayout *layout, View2D *v2d) int i; int sy; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShade(TH_BACK, -7); @@ -486,14 +486,14 @@ static void draw_dividers(FileLayout *layout, View2D *v2d) const int step = (layout->tile_w + 2 * layout->tile_border_x); - unsigned int vertex_ct = 0; + unsigned int vertex_len = 0; int sx = (int)v2d->tot.xmin; while (sx < v2d->cur.xmax) { sx += step; - vertex_ct += 4; /* vertex_count = 2 points per line * 2 lines per divider */ + vertex_len += 4; /* vertex_count = 2 points per line * 2 lines per divider */ } - if (vertex_ct > 0) { + if (vertex_len > 0) { int v1[2], v2[2]; unsigned char col_hi[3], col_lo[3]; @@ -504,11 +504,11 @@ static void draw_dividers(FileLayout *layout, View2D *v2d) v2[1] = v2d->cur.ymin; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); - immBegin(GWN_PRIM_LINES, vertex_ct); + immBegin(GWN_PRIM_LINES, vertex_len); sx = (int)v2d->tot.xmin; while (sx < v2d->cur.xmax) { diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 09e2660a762..968757bc637 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -2357,7 +2357,7 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist) filelist->filelist.entries[9].entry->relpath = BLI_strdup("Ika"); filelist->filelist.entries[10].entry->relpath = BLI_strdup("Wave"); filelist->filelist.entries[11].entry->relpath = BLI_strdup("Lattice"); - filelist->filelist.entries[12].entry->relpath = BLI_strdup("Lamp"); + filelist->filelist.entries[12].entry->relpath = BLI_strdup("Light"); filelist->filelist.entries[13].entry->relpath = BLI_strdup("Camera"); filelist->filelist.entries[14].entry->relpath = BLI_strdup("Ipo"); filelist->filelist.entries[15].entry->relpath = BLI_strdup("World"); diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 4e9f8cd3733..16658c0d8db 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -286,7 +286,7 @@ static void draw_fcurve_vertices(ARegion *ar, FCurve *fcu, bool do_handles, bool * - draw handles before keyframes, so that keyframes will overlap handles (keyframes are more important for users) */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); GPU_blend(true); GPU_enable_program_point_size(); @@ -331,8 +331,8 @@ static void draw_fcurve_handles(SpaceIpo *sipo, FCurve *fcu) int sel, b; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); immBeginAtMost(GWN_PRIM_LINES, 4 * 2 * fcu->totvert); @@ -459,7 +459,7 @@ static void draw_fcurve_samples(SpaceIpo *sipo, ARegion *ar, FCurve *fcu) if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) GPU_line_smooth(true); GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor((fcu->flag & FCURVE_SELECTED) ? TH_TEXT_HI : TH_TEXT); diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index c94f2b00db2..699dc29ff47 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -279,7 +279,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar) UI_view2d_grid_free(grid); if (((sipo->flag & SIPO_NODRAWCURSOR) == 0) || (sipo->mode == SIPO_MODE_DRIVERS)) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index f70efa00244..24b02106021 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -127,7 +127,7 @@ static void draw_render_info(const bContext *C, (int)(-rd->border.ymin * rd->ysch * rd->size * 0.01f)); } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_FACE_SELECT); @@ -174,7 +174,7 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, bool color_manage, bool use_d GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* noisy, high contrast make impossible to read if lower alpha is used. */ @@ -574,7 +574,7 @@ void draw_image_sample_line(SpaceImage *sima) Histogram *hist = &sima->sample_line_hist; Gwn_VertFormat *format = immVertexFormat(); - unsigned int shdr_dashed_pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint shdr_dashed_pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR); @@ -779,7 +779,7 @@ void draw_image_cache(const bContext *C, ARegion *ar) /* Draw current frame. */ x = (cfra - sfra) / (efra - sfra + 1) * ar->winx; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_CFRAME); immRecti(pos, x, 0, x + ceilf(framelen), 8 * UI_DPI_FAC); diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index a1e3842f887..5c1b23e140c 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -86,7 +86,7 @@ static void console_draw_sel(const char *str, const int sel[2], const int xy[2], GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv(bg_sel); @@ -192,7 +192,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str if (bg) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ubv(bg); @@ -243,7 +243,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str if (bg) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ubv(bg); diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index a21a62dc8e8..3f1bd0db74c 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -121,7 +121,7 @@ static void nla_action_draw_keyframes(AnimData *adt, bAction *act, float y, floa color[3] *= 2.5f; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -138,17 +138,17 @@ static void nla_action_draw_keyframes(AnimData *adt, bAction *act, float y, floa /* count keys before drawing */ /* Note: It's safe to cast DLRBT_Tree, as it's designed to degrade down to a ListBase */ - unsigned int key_ct = BLI_listbase_count((ListBase *)&keys); + uint key_len = BLI_listbase_count((ListBase *)&keys); - if (key_ct > 0) { + if (key_len > 0) { format = immVertexFormat(); pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); - unsigned int outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); GPU_enable_program_point_size(); - immBegin(GWN_PRIM_POINTS, key_ct); + immBegin(GWN_PRIM_POINTS, key_len); /* - disregard the selection status of keyframes so they draw a certain way * - size is 6.0f which is smaller than the editable keyframes, so that there is a distinction @@ -706,7 +706,7 @@ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *ar) { AnimData *adt = ale->adt; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* just draw a semi-shaded rect spanning the width of the viewable area if there's data, diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index d7015ed5e53..335c135cfba 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1215,7 +1215,7 @@ static void node_shader_set_butfunc(bNodeType *ntype) ntype->draw_buttons = node_shader_buts_uvalongstroke; break; case SH_NODE_OUTPUT_MATERIAL: - case SH_NODE_OUTPUT_LAMP: + case SH_NODE_OUTPUT_LIGHT: case SH_NODE_OUTPUT_WORLD: ntype->draw_buttons = node_buts_output_shader; break; @@ -2182,7 +2182,7 @@ static void node_composit_backdrop_viewer(SpaceNode *snode, ImBuf *backdrop, bNo const float cross_size = 12 * U.pixelsize; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -2227,7 +2227,7 @@ static void node_composit_backdrop_boxmask(SpaceNode *snode, ImBuf *backdrop, bN y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -2271,7 +2271,7 @@ static void node_composit_backdrop_ellipsemask(SpaceNode *snode, ImBuf *backdrop y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -3264,7 +3264,7 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode, b y + snode->zoom * viewer_border->ymin * ibuf->y, y + snode->zoom * viewer_border->ymax * ibuf->y); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_ACTIVE); @@ -3423,9 +3423,9 @@ static void set_nodelink_vertex( static void nodelink_batch_init(void) { Gwn_VertFormat format = {0}; - unsigned int uv_id = GWN_vertformat_attr_add(&format, "uv", GWN_COMP_U8, 2, GWN_FETCH_INT_TO_FLOAT_UNIT); - unsigned int pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int expand_id = GWN_vertformat_attr_add(&format, "expand", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint uv_id = GWN_vertformat_attr_add(&format, "uv", GWN_COMP_U8, 2, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint expand_id = GWN_vertformat_attr_add(&format, "expand", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format_ex(&format, GWN_USAGE_STATIC); int vcount = LINK_RESOL * 2; /* curve */ vcount += 2; /* restart strip */ diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index c4ed35faabd..5b91796d41c 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -649,7 +649,7 @@ static void node_draw_preview_background(float tile, rctf *rect) float x, y; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -721,7 +721,7 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv) GPU_blend(false); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShadeAlpha(TH_BACK, -15, +100); imm_draw_box_wire_2d(pos, draw_rect.xmin, draw_rect.ymin, draw_rect.xmax, draw_rect.ymax); @@ -758,10 +758,10 @@ void node_draw_shadow(SpaceNode *snode, bNode *node, float radius, float alpha) void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode *node, bool draw_outputs, bool select_all) { - const unsigned int total_input_ct = BLI_listbase_count(&node->inputs); - const unsigned int total_output_ct = BLI_listbase_count(&node->outputs); + const uint total_input_len = BLI_listbase_count(&node->inputs); + const uint total_output_len = BLI_listbase_count(&node->outputs); - if (total_input_ct + total_output_ct == 0) { + if (total_input_len + total_output_len == 0) { return; } @@ -772,8 +772,8 @@ void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode * UI_view2d_scale_get(v2d, &scale, NULL); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); GPU_blend(true); GPU_enable_program_point_size(); @@ -788,17 +788,17 @@ void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode * immUniform1f("outlineWidth", 1.0f); immUniform4f("outlineColor", 0.0f, 0.0f, 0.0f, 0.6f); - immBeginAtMost(GWN_PRIM_POINTS, total_input_ct + total_output_ct); + immBeginAtMost(GWN_PRIM_POINTS, total_input_len + total_output_len); } /* socket inputs */ - short selected_input_ct = 0; + short selected_input_len = 0; bNodeSocket *sock; for (sock = node->inputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { - ++selected_input_ct; + ++selected_input_len; continue; } @@ -806,13 +806,13 @@ void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode * } /* socket outputs */ - short selected_output_ct = 0; + short selected_output_len = 0; if (draw_outputs) { for (sock = node->outputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { - ++selected_output_ct; + ++selected_output_len; continue; } @@ -825,36 +825,36 @@ void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode * } /* go back and draw selected sockets */ - if (selected_input_ct + selected_output_ct > 0) { + if (selected_input_len + selected_output_len > 0) { /* outline for selected sockets */ float c[3]; UI_GetThemeColor3fv(TH_TEXT_HI, c); immUniform4f("outlineColor", c[0], c[1], c[2], 1.0f); immUniform1f("outlineWidth", 1.5f); - immBegin(GWN_PRIM_POINTS, selected_input_ct + selected_output_ct); + immBegin(GWN_PRIM_POINTS, selected_input_len + selected_output_len); - if (selected_input_ct) { + if (selected_input_len) { /* socket inputs */ for (sock = node->inputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { node_socket_circle_draw(C, ntree, node_ptr, sock, pos, col); - if (--selected_input_ct == 0) + if (--selected_input_len == 0) break; /* stop as soon as last one is drawn */ } } } - if (selected_output_ct) { + if (selected_output_len) { /* socket outputs */ for (sock = node->outputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { node_socket_circle_draw(C, ntree, node_ptr, sock, pos, col); - if (--selected_output_ct == 0) + if (--selected_output_len == 0) break; /* stop as soon as last one is drawn */ } } @@ -1102,7 +1102,7 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b } /* scale widget thing */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShade(color_id, -10); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index cc32e5ef499..1a6710035c2 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -424,7 +424,7 @@ void ED_node_shader_default(const bContext *C, ID *id) Lamp *la = (Lamp *)id; la->nodetree = ntree; - output_type = SH_NODE_OUTPUT_LAMP; + output_type = SH_NODE_OUTPUT_LIGHT; shader_type = SH_NODE_EMISSION; copy_v3_v3(color, &la->r); @@ -628,7 +628,7 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node) nodeClearActiveID(ntree, ID_TE); if (ELEM(node->type, SH_NODE_OUTPUT_MATERIAL, - SH_NODE_OUTPUT_WORLD, SH_NODE_OUTPUT_LAMP, SH_NODE_OUTPUT_LINESTYLE)) + SH_NODE_OUTPUT_WORLD, SH_NODE_OUTPUT_LIGHT, SH_NODE_OUTPUT_LINESTYLE)) { bNode *tnode; diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index b884db1ced4..e3aeb0244e8 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -446,21 +446,12 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname) uiBut *but; NodeLinkArg *argN; int first = 1; - int compatibility = 0; - - if (ntree->type == NTREE_SHADER) { - compatibility = NODE_NEW_SHADING; - } /* generate array of node types sorted by UI name */ bNodeType **sorted_ntypes = NULL; BLI_array_declare(sorted_ntypes); NODE_TYPES_BEGIN(ntype) { - if (compatibility && !(ntype->compatibility & compatibility)) { - continue; - } - if (ntype->nclass != nclass) { continue; } diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index ed4853f5ede..8a8f4715ea3 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -742,7 +742,7 @@ static void outliner_draw_rnacols(ARegion *ar, int sizex) GPU_line_width(1.0f); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShadeAlpha(TH_BACK, -15, -200); @@ -1141,7 +1141,7 @@ static void tselem_draw_icon( ICON_DRAW(ICON_RENDER_RESULT); break; case TSE_LINKED_LAMP: - ICON_DRAW(ICON_LAMP_DATA); + ICON_DRAW(ICON_LIGHT_DATA); break; case TSE_LINKED_MAT: ICON_DRAW(ICON_MATERIAL_DATA); @@ -1200,7 +1200,7 @@ static void tselem_draw_icon( Object *ob = (Object *)tselem->id; switch (ob->type) { case OB_LAMP: - ICON_CLICK_DRAW(ICON_OUTLINER_OB_LAMP); break; + ICON_CLICK_DRAW(ICON_OUTLINER_OB_LIGHT); break; case OB_MESH: ICON_CLICK_DRAW(ICON_OUTLINER_OB_MESH); break; case OB_CAMERA: @@ -1251,17 +1251,17 @@ static void tselem_draw_icon( Lamp *la = (Lamp *)tselem->id; switch (la->type) { case LA_LOCAL: - tselem_draw_icon_uibut(&arg, ICON_LAMP_POINT); break; + tselem_draw_icon_uibut(&arg, ICON_LIGHT_POINT); break; case LA_SUN: - tselem_draw_icon_uibut(&arg, ICON_LAMP_SUN); break; + tselem_draw_icon_uibut(&arg, ICON_LIGHT_SUN); break; case LA_SPOT: - tselem_draw_icon_uibut(&arg, ICON_LAMP_SPOT); break; + tselem_draw_icon_uibut(&arg, ICON_LIGHT_SPOT); break; case LA_HEMI: - tselem_draw_icon_uibut(&arg, ICON_LAMP_HEMI); break; + tselem_draw_icon_uibut(&arg, ICON_LIGHT_HEMI); break; case LA_AREA: - tselem_draw_icon_uibut(&arg, ICON_LAMP_AREA); break; + tselem_draw_icon_uibut(&arg, ICON_LIGHT_AREA); break; default: - tselem_draw_icon_uibut(&arg, ICON_OUTLINER_DATA_LAMP); break; + tselem_draw_icon_uibut(&arg, ICON_OUTLINER_DATA_LIGHT); break; } break; } @@ -1740,7 +1740,7 @@ static void outliner_draw_tree_element( /* divider */ { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); unsigned char col[4]; immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1797,7 +1797,7 @@ static void outliner_draw_tree_element_floating( const TreeElement *te_insert = te_floating->drag_data->insert_handle; const int line_width = 2; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); int coord_y = te_insert->ys; int coord_x = te_insert->xs; float col[4]; @@ -1902,7 +1902,7 @@ static void outliner_draw_hierarchy_lines_recursive( static void outliner_draw_hierarchy_lines(SpaceOops *soops, ListBase *lb, int startx, int *starty) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); unsigned char col[4]; immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1925,7 +1925,7 @@ static void outliner_draw_struct_marks(ARegion *ar, SpaceOops *soops, ListBase * if (TSELEM_OPEN(tselem, soops)) { if (tselem->type == TSE_RNA_STRUCT) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immThemeColorShadeAlpha(TH_BACK, -15, -200); immRecti(pos, 0, *starty + 1, (int)ar->v2d.cur.xmax, *starty + UI_UNIT_Y - 1); @@ -1938,7 +1938,7 @@ static void outliner_draw_struct_marks(ARegion *ar, SpaceOops *soops, ListBase * outliner_draw_struct_marks(ar, soops, &te->subtree, starty); if (tselem->type == TSE_RNA_STRUCT) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immThemeColorShadeAlpha(TH_BACK, -15, -200); @@ -2008,7 +2008,7 @@ static void outliner_draw_highlights(ARegion *ar, SpaceOops *soops, int startx, GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); outliner_draw_highlights_recursive( pos, ar, soops, &soops->tree, col_selection, col_highlight, col_searchmatch, @@ -2083,7 +2083,7 @@ static void outliner_back(ARegion *ar) ystart = UI_UNIT_Y * (ystart / (UI_UNIT_Y)) - OL_Y_OFFSET; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShade(TH_BACK, 6); @@ -2114,7 +2114,7 @@ static void outliner_draw_restrictcols(ARegion *ar) { GPU_line_width(1.0f); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShadeAlpha(TH_BACK, -15, -200); immBegin(GWN_PRIM_LINES, 8); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 7da20131069..a10eda5c3e6 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -343,7 +343,7 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1, col[3] = 196; /* alpha, used for all meta children */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -719,7 +719,7 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg x2 = (seq->endstill) ? (seq->start + seq->len) : seq->enddisp; y2 = seq->machine + SEQ_STRIP_OFSTOP; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1231,8 +1231,8 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq * Do it here because OCIO binds it's own shader. */ Gwn_VertFormat *imm_format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(imm_format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int texCoord = GWN_vertformat_attr_add(imm_format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(imm_format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texCoord = GWN_vertformat_attr_add(imm_format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); if (scope) { IMB_freeImBuf(ibuf); @@ -1514,7 +1514,7 @@ static void draw_seq_backdrop(View2D *v2d) { int i; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* darker gray overlay over the view backdrop */ @@ -1539,10 +1539,10 @@ static void draw_seq_backdrop(View2D *v2d) /* Darker lines separating the horizontal bands */ i = max_ii(1, ((int)v2d->cur.ymin) - 1); - int line_ct = (int)v2d->cur.ymax - i + 1; + int line_len = (int)v2d->cur.ymax - i + 1; immUniformThemeColor(TH_GRID); - immBegin(GWN_PRIM_LINES, line_ct * 2); - while (line_ct--) { + immBegin(GWN_PRIM_LINES, line_len * 2); + while (line_len--) { immVertex2f(pos, v2d->cur.xmax, i); immVertex2f(pos, v2d->cur.xmin, i); } @@ -1593,7 +1593,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) const Sequence *seq = special_seq_update; GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ub(255, 255, 255, 48); @@ -1613,7 +1613,7 @@ static void seq_draw_sfra_efra(Scene *scene, View2D *v2d) GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* draw darkened area outside of active timeline @@ -1735,7 +1735,7 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) if (scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW) { int cfra_over = (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) ? scene->ed->over_cfra : scene->r.cfra + scene->ed->over_ofs; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3f(0.2f, 0.2f, 0.2f); diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 21cd24cf84c..748a5c05ef1 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -913,7 +913,7 @@ static void draw_textscroll(const SpaceText *st, rcti *scroll, rcti *back) float rad; /* background so highlights don't go behind the scrollbar */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_BACK); immRecti(pos, back->xmin, back->ymin, back->xmax, back->ymax); @@ -967,7 +967,7 @@ static void draw_documentation(const SpaceText *st, ARegion *ar) boxh = (DOC_HEIGHT + 1) * (st->lheight_dpi + TXT_LINE_SPACING); /* Draw panel */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_BACK); @@ -1066,7 +1066,7 @@ static void draw_suggestion_list(const SpaceText *st, const TextDrawContext *tdc /* not needed but stands out nicer */ UI_draw_box_shadow(220, x, y - boxh, x + boxw, y); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_SHADE1); @@ -1089,7 +1089,7 @@ static void draw_suggestion_list(const SpaceText *st, const TextDrawContext *tdc w = st->cwidth * text_get_char_pos(st, str, len); if (item == sel) { - unsigned int posi = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint posi = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_SHADE2); @@ -1130,7 +1130,7 @@ static void draw_text_decoration(SpaceText *st, ARegion *ar) return; } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* Draw the selection */ @@ -1443,7 +1443,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) if (st->showlinenrs) { x = TXT_OFFSET + TEXTXLOC; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_GRID); immRecti(pos, (TXT_OFFSET - 12), 0, (TXT_OFFSET - 5) + TEXTXLOC, ar->winy - 2); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index bca5faa314a..beb323fb21c 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -748,7 +748,7 @@ void ED_draw_object_facemap( const int *facemap_data = CustomData_get_layer(&me->pdata, CD_FACEMAP); if (facemap_data) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor4fv(col); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 7495733382c..9aaced3e583 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1065,11 +1065,11 @@ static void view3d_main_region_message_subscribe( &RNA_Window, /* These object have properties that impact drawing. */ - &RNA_AreaLamp, + &RNA_AreaLight, &RNA_Camera, - &RNA_Lamp, + &RNA_Light, &RNA_Speaker, - &RNA_SunLamp, + &RNA_SunLight, /* General types the 3D view depends on. */ &RNA_Object, diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index bcf9a7c4ad1..8fa327d8782 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1226,7 +1226,7 @@ void VIEW3D_OT_properties(wmOperatorType *ot) static int view3d_object_mode_menu(bContext *C, wmOperator *UNUSED(op)) { Object *ob = CTX_data_active_object(C); - if (ob->type == OB_ARMATURE) { + if (ob && ((ob->mode & OB_MODE_EDIT) == 0) && (ELEM(ob->type, OB_ARMATURE))) { ED_object_mode_toggle(C, OB_MODE_POSE); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index a428b60643d..2c732586606 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -814,8 +814,8 @@ static void draw_view_axis(RegionView3D *rv3d, const rcti *rect) GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); immBegin(GWN_PRIM_LINES, 6); @@ -859,8 +859,8 @@ static void UNUSED_FUNCTION(draw_rotation_guide)(RegionView3D *rv3d) glDepthMask(GL_FALSE); /* don't overwrite zbuf */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_3D_SMOOTH_COLOR); diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index f9fdf8c2cc0..8c6bbaa94da 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -263,7 +263,7 @@ static void drawFlyPixel(const struct bContext *UNUSED(C), ARegion *UNUSED(ar), y2 = yoff + 0.55f * fly->height; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_view3d/view3d_manipulator_empty.c b/source/blender/editors/space_view3d/view3d_manipulator_empty.c index 75e4a9e3314..fc15ec593f5 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_empty.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_empty.c @@ -186,7 +186,7 @@ static void WIDGETGROUP_empty_image_refresh(const bContext *C, wmManipulatorGrou void VIEW3D_WGT_empty_image(wmManipulatorGroupType *wgt) { - wgt->name = "Area Lamp Widgets"; + wgt->name = "Area Light Widgets"; wgt->idname = "VIEW3D_WGT_empty_image"; wgt->flag |= (WM_MANIPULATORGROUPTYPE_PERSISTENT | diff --git a/source/blender/editors/space_view3d/view3d_manipulator_lamp.c b/source/blender/editors/space_view3d/view3d_manipulator_lamp.c index f98a2f336bc..0e1015a66f1 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_lamp.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_lamp.c @@ -99,13 +99,13 @@ static void WIDGETGROUP_lamp_spot_refresh(const bContext *C, wmManipulatorGroup /* need to set property here for undo. TODO would prefer to do this in _init */ PointerRNA lamp_ptr; const char *propname = "spot_size"; - RNA_pointer_create(&la->id, &RNA_Lamp, la, &lamp_ptr); + RNA_pointer_create(&la->id, &RNA_Light, la, &lamp_ptr); WM_manipulator_target_property_def_rna(mpr, "offset", &lamp_ptr, propname, -1); } void VIEW3D_WGT_lamp_spot(wmManipulatorGroupType *wgt) { - wgt->name = "Spot Lamp Widgets"; + wgt->name = "Spot Light Widgets"; wgt->idname = "VIEW3D_WGT_lamp_spot"; wgt->flag |= (WM_MANIPULATORGROUPTYPE_PERSISTENT | @@ -213,7 +213,7 @@ static void WIDGETGROUP_lamp_area_refresh(const bContext *C, wmManipulatorGroup void VIEW3D_WGT_lamp_area(wmManipulatorGroupType *wgt) { - wgt->name = "Area Lamp Widgets"; + wgt->name = "Area Light Widgets"; wgt->idname = "VIEW3D_WGT_lamp_area"; wgt->flag |= (WM_MANIPULATORGROUPTYPE_PERSISTENT | @@ -291,7 +291,7 @@ static void WIDGETGROUP_lamp_target_draw_prepare(const bContext *C, wmManipulato void VIEW3D_WGT_lamp_target(wmManipulatorGroupType *wgt) { - wgt->name = "Target Lamp Widgets"; + wgt->name = "Target Light Widgets"; wgt->idname = "VIEW3D_WGT_lamp_target"; wgt->flag |= (WM_MANIPULATORGROUPTYPE_PERSISTENT | diff --git a/source/blender/editors/space_view3d/view3d_manipulator_ruler.c b/source/blender/editors/space_view3d/view3d_manipulator_ruler.c index c33f15c0493..d102fdc6e04 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_ruler.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_ruler.c @@ -793,7 +793,7 @@ static void manipulator_ruler_draw(const bContext *C, wmManipulator *mpr) float co_ss_snap[3]; ED_view3d_project_float_global(ar, ruler_item->co[inter->co_index], co_ss_snap, V3D_PROJ_TEST_NOP); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(color_act); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 00f0dea8fe2..0fd109f858d 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -311,7 +311,8 @@ void view3d_keymap(wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "center", true); #endif - WM_keymap_add_menu_pie(keymap, "VIEW3D_MT_view_pie", ACCENTGRAVEKEY, KM_CLICK_DRAG, 0, 0); + WM_keymap_add_menu_pie(keymap, "VIEW3D_MT_view_pie", ACCENTGRAVEKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_navigate", ACCENTGRAVEKEY, KM_PRESS, KM_SHIFT, 0); /* numpad view hotkeys*/ WM_keymap_add_item(keymap, "VIEW3D_OT_view_camera", PAD0, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_view3d/view3d_ruler.c b/source/blender/editors/space_view3d/view3d_ruler.c index 5911c8224be..4617b92c780 100644 --- a/source/blender/editors/space_view3d/view3d_ruler.c +++ b/source/blender/editors/space_view3d/view3d_ruler.c @@ -703,7 +703,7 @@ static void ruler_info_draw_pixel(const struct bContext *C, ARegion *ar, void *a float co_ss[3]; ED_view3d_project_float_global(ar, ruler_item->co[ruler_item->co_index], co_ss, V3D_PROJ_TEST_NOP); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(color_act); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index b7dbb09e1a4..0f82dfa775c 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1062,6 +1062,8 @@ static Base *object_mouse_select_menu( short baseCount = 0; bool ok; LinkNode *linklist = NULL; + const int object_type_exclude_select = ( + vc->v3d->object_type_exclude_viewport | vc->v3d->object_type_exclude_select); /* handle base->object->select_color */ CTX_DATA_BEGIN (C, Base *, base, selectable_bases) @@ -1079,6 +1081,9 @@ static Base *object_mouse_select_menu( } } else { + if (object_type_exclude_select & (1 << base->object->type)) { + continue; + } const int dist = 15 * U.pixelsize; if (ED_view3d_project_base(vc->ar, base) == V3D_PROJ_RET_OK) { const int delta_px[2] = {base->sx - mval[0], base->sy - mval[1]}; @@ -1447,9 +1452,13 @@ static bool ed_object_select_pick( basact = object_mouse_select_menu(C, &vc, NULL, 0, mval, toggle); } else { + const int object_type_exclude_select = ( + vc.v3d->object_type_exclude_viewport | vc.v3d->object_type_exclude_select); base = startbase; while (base) { - if (BASE_SELECTABLE(base)) { + if (BASE_SELECTABLE(base) && + ((object_type_exclude_select & (1 << base->object->type)) == 0)) + { float screen_co[2]; if (ED_view3d_project_float_global( ar, base->object->obmat[3], screen_co, diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index e3e82e8b9c2..7356d4a6eea 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -344,7 +344,7 @@ static void drawWalkPixel(const struct bContext *UNUSED(C), ARegion *ar, void *a } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index d26da986a6c..1f2589d8a0c 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -813,25 +813,100 @@ enum { TFM_MODAL_INSERTOFS_TOGGLE_DIR = 27, }; +static bool transform_modal_item_poll(const wmOperator *op, int value) +{ + const TransInfo *t = op->customdata; + switch (value) { + case TFM_MODAL_PROPSIZE: + case TFM_MODAL_PROPSIZE_UP: + case TFM_MODAL_PROPSIZE_DOWN: + { + if ((t->flag & T_PROP_EDIT) == 0) { + return false; + } + break; + } + case TFM_MODAL_ADD_SNAP: + case TFM_MODAL_REMOVE_SNAP: + { + if (t->spacetype != SPACE_VIEW3D) { + return false; + } + else if (t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID)) { + return false; + } + else if (!validSnap(t)) { + return false; + } + break; + } + case TFM_MODAL_AXIS_X: + case TFM_MODAL_AXIS_Y: + case TFM_MODAL_AXIS_Z: + case TFM_MODAL_PLANE_X: + case TFM_MODAL_PLANE_Y: + case TFM_MODAL_PLANE_Z: + { + if (t->flag & T_NO_CONSTRAINT) { + return false; + } + if (!ELEM(value, TFM_MODAL_AXIS_X, TFM_MODAL_AXIS_Y)) { + if (t->flag & T_2D_EDIT) { + return false; + } + } + break; + } + case TFM_MODAL_CONS_OFF: + { + if ((t->con.mode & CON_APPLY) == 0) { + return false; + } + break; + } + case TFM_MODAL_EDGESLIDE_UP: + case TFM_MODAL_EDGESLIDE_DOWN: + { + if (t->mode != TFM_EDGE_SLIDE) { + return false; + } + break; + } + case TFM_MODAL_INSERTOFS_TOGGLE_DIR: + { + if (t->spacetype != SPACE_NODE) { + return false; + } + break; + } + case TFM_MODAL_AUTOIK_LEN_INC: + case TFM_MODAL_AUTOIK_LEN_DEC: + { + if ((t->flag & T_AUTOIK) == 0) { + return false; + } + break; + } + } + return true; +} + /* called in transform_ops.c, on each regeneration of keymaps */ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf) { static const EnumPropertyItem modal_items[] = { - {TFM_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, {TFM_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""}, - {TFM_MODAL_TRANSLATE, "TRANSLATE", 0, "Translate", ""}, - {TFM_MODAL_ROTATE, "ROTATE", 0, "Rotate", ""}, - {TFM_MODAL_RESIZE, "RESIZE", 0, "Resize", ""}, - {TFM_MODAL_SNAP_INV_ON, "SNAP_INV_ON", 0, "Invert Snap On", ""}, + {TFM_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, + {TFM_MODAL_AXIS_X, "AXIS_X", 0, "X axis", ""}, + {TFM_MODAL_AXIS_Y, "AXIS_Y", 0, "Y axis", ""}, + {TFM_MODAL_AXIS_Z, "AXIS_Z", 0, "Z axis", ""}, + {TFM_MODAL_PLANE_X, "PLANE_X", 0, "X plane", ""}, + {TFM_MODAL_PLANE_Y, "PLANE_Y", 0, "Y plane", ""}, + {TFM_MODAL_PLANE_Z, "PLANE_Z", 0, "Z plane", ""}, + {TFM_MODAL_CONS_OFF, "CONS_OFF", 0, "Clear Constraints", ""}, + {TFM_MODAL_SNAP_INV_ON, "SNAP_INV_ON", 0, "Invert Snap", ""}, {TFM_MODAL_SNAP_INV_OFF, "SNAP_INV_OFF", 0, "Invert Snap Off", ""}, {TFM_MODAL_SNAP_TOGGLE, "SNAP_TOGGLE", 0, "Snap Toggle", ""}, - {TFM_MODAL_AXIS_X, "AXIS_X", 0, "Orientation X axis", ""}, - {TFM_MODAL_AXIS_Y, "AXIS_Y", 0, "Orientation Y axis", ""}, - {TFM_MODAL_AXIS_Z, "AXIS_Z", 0, "Orientation Z axis", ""}, - {TFM_MODAL_PLANE_X, "PLANE_X", 0, "Orientation X plane", ""}, - {TFM_MODAL_PLANE_Y, "PLANE_Y", 0, "Orientation Y plane", ""}, - {TFM_MODAL_PLANE_Z, "PLANE_Z", 0, "Orientation Z plane", ""}, - {TFM_MODAL_CONS_OFF, "CONS_OFF", 0, "Remove Constraints", ""}, {TFM_MODAL_ADD_SNAP, "ADD_SNAP", 0, "Add Snap Point", ""}, {TFM_MODAL_REMOVE_SNAP, "REMOVE_SNAP", 0, "Remove Last Snap Point", ""}, {NUM_MODAL_INCREMENT_UP, "INCREMENT_UP", 0, "Numinput Increment Up", ""}, @@ -844,6 +919,9 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf) {TFM_MODAL_EDGESLIDE_DOWN, "EDGESLIDE_PREV_NEXT", 0, "Select previous Edge Slide Edge", ""}, {TFM_MODAL_PROPSIZE, "PROPORTIONAL_SIZE", 0, "Adjust Proportional Influence", ""}, {TFM_MODAL_INSERTOFS_TOGGLE_DIR, "INSERTOFS_TOGGLE_DIR", 0, "Toggle Direction for Node Auto-offset", ""}, + {TFM_MODAL_TRANSLATE, "TRANSLATE", 0, "Translate", ""}, + {TFM_MODAL_ROTATE, "ROTATE", 0, "Rotate", ""}, + {TFM_MODAL_RESIZE, "RESIZE", 0, "Resize", ""}, {0, NULL, 0, NULL, NULL} }; @@ -853,12 +931,24 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf) if (keymap && keymap->modal_items) return NULL; keymap = WM_modalkeymap_add(keyconf, "Transform Modal Map", modal_items); + keymap->poll_modal_item = transform_modal_item_poll; /* items for modal map */ - WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_CANCEL); - WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); - WM_modalkeymap_add_item(keymap, RETKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); - WM_modalkeymap_add_item(keymap, PADENTER, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); + WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); + WM_modalkeymap_add_item(keymap, RETKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); + WM_modalkeymap_add_item(keymap, PADENTER, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); + WM_modalkeymap_add_item(keymap, RIGHTMOUSE, KM_PRESS, KM_ANY, 0, TFM_MODAL_CANCEL); + WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_CANCEL); + + WM_modalkeymap_add_item(keymap, XKEY, KM_PRESS, 0, 0, TFM_MODAL_AXIS_X); + WM_modalkeymap_add_item(keymap, YKEY, KM_PRESS, 0, 0, TFM_MODAL_AXIS_Y); + WM_modalkeymap_add_item(keymap, ZKEY, KM_PRESS, 0, 0, TFM_MODAL_AXIS_Z); + + WM_modalkeymap_add_item(keymap, XKEY, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_PLANE_X); + WM_modalkeymap_add_item(keymap, YKEY, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_PLANE_Y); + WM_modalkeymap_add_item(keymap, ZKEY, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_PLANE_Z); + + WM_modalkeymap_add_item(keymap, CKEY, KM_PRESS, 0, 0, TFM_MODAL_CONS_OFF); WM_modalkeymap_add_item(keymap, GKEY, KM_PRESS, 0, 0, TFM_MODAL_TRANSLATE); WM_modalkeymap_add_item(keymap, RKEY, KM_PRESS, 0, 0, TFM_MODAL_ROTATE); @@ -1410,21 +1500,6 @@ int transformEvent(TransInfo *t, const wmEvent *event) handled = true; } } - else { - if (!(t->flag & T_NO_CONSTRAINT)) { - stopConstraint(t); - t->redraw |= TREDRAW_HARD; - handled = true; - } - } - break; - case XKEY: - case YKEY: - case ZKEY: - if (!(t->flag & T_NO_CONSTRAINT)) { - transform_event_xyz_constraint(t, event->type, cmode); - handled = true; - } break; case OKEY: if (t->flag & T_PROP_EDIT && event->shift) { @@ -1551,6 +1626,12 @@ int transformEvent(TransInfo *t, const wmEvent *event) handled = true; } + if (t->redraw && + !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) + { + WM_window_status_area_tag_redraw(CTX_wm_window(t->context)); + } + if (handled || t->redraw) { return 0; } @@ -1774,7 +1855,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata) } /* And now, solid lines. */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); UNUSED_VARS_NDEBUG(pos); /* silence warning */ BLI_assert(pos == POS_INDEX); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -6982,7 +7063,7 @@ static void drawEdgeSlide(TransInfo *t) gpuPushMatrix(); gpuMultMatrix(TRANS_DATA_CONTAINER_FIRST_OK(t)->obedit->obmat); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 744170d9aba..6685f785247 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -772,8 +772,8 @@ void snapGridIncrementAction(TransInfo *t, float *val, GearsType action); void snapSequenceBounds(TransInfo *t, const int mval[2]); -bool activeSnap(TransInfo *t); -bool validSnap(TransInfo *t); +bool activeSnap(const TransInfo *t); +bool validSnap(const TransInfo *t); void initSnapping(struct TransInfo *t, struct wmOperator *op); void freeSnapping(struct TransInfo *t); @@ -783,10 +783,10 @@ void applySnapping(TransInfo *t, float *vec); void resetSnapping(TransInfo *t); eRedrawFlag handleSnapping(TransInfo *t, const struct wmEvent *event); void drawSnapping(const struct bContext *C, TransInfo *t); -bool usingSnappingNormal(TransInfo *t); -bool validSnappingNormal(TransInfo *t); +bool usingSnappingNormal(const TransInfo *t); +bool validSnappingNormal(const TransInfo *t); -void getSnapPoint(TransInfo *t, float vec[3]); +void getSnapPoint(const TransInfo *t, float vec[3]); void addSnapPoint(TransInfo *t); eRedrawFlag updateSelectedSnapPoint(TransInfo *t); void removeSnapPoint(TransInfo *t); diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 9df8264cc76..d40602f8d43 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -823,7 +823,7 @@ void drawPropCircle(const struct bContext *C, TransInfo *t) if (depth_test_enabled) GPU_depth_test(false); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformThemeColor(TH_GRID); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index b007a8d1b99..3f71915a690 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1132,7 +1132,7 @@ void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis } UI_make_axis_color(col, col2, axis); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor3ubv(col2); diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 9ffd14ad956..dc922b5c9ba 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -124,13 +124,13 @@ int BIF_snappingSupported(Object *obedit) } #endif -bool validSnap(TransInfo *t) +bool validSnap(const TransInfo *t) { return (t->tsnap.status & (POINT_INIT | TARGET_INIT)) == (POINT_INIT | TARGET_INIT) || (t->tsnap.status & (MULTI_POINTS | TARGET_INIT)) == (MULTI_POINTS | TARGET_INIT); } -bool activeSnap(TransInfo *t) +bool activeSnap(const TransInfo *t) { return ((t->modifiers & (MOD_SNAP | MOD_SNAP_INVERT)) == MOD_SNAP) || ((t->modifiers & (MOD_SNAP | MOD_SNAP_INVERT)) == MOD_SNAP_INVERT); @@ -165,7 +165,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t) invert_m4_m4(imat, rv3d->viewmat); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); @@ -219,7 +219,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t) GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -451,12 +451,12 @@ void resetSnapping(TransInfo *t) t->tsnap.snapNodeBorder = 0; } -bool usingSnappingNormal(TransInfo *t) +bool usingSnappingNormal(const TransInfo *t) { return t->tsnap.align; } -bool validSnappingNormal(TransInfo *t) +bool validSnappingNormal(const TransInfo *t) { if (validSnap(t)) { if (!is_zero_v3(t->tsnap.snapNormal)) { @@ -789,7 +789,7 @@ void removeSnapPoint(TransInfo *t) } } -void getSnapPoint(TransInfo *t, float vec[3]) +void getSnapPoint(const TransInfo *t, float vec[3]) { if (t->tsnap.points.first) { TransSnapPoint *p; diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 411c4838252..f0d6b5c2a71 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -168,7 +168,7 @@ static void draw_uvs_shadow(Object *obedit) const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -229,7 +229,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, Object *obedit, BME } } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -309,8 +309,8 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, Object *obedit, BME col[3] = 0.5f; /* hard coded alpha, not that nice */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); @@ -495,7 +495,7 @@ static void draw_uvs_other_mesh(Object *ob, const Image *curimage, static void draw_uvs_other(ViewLayer *view_layer, Object *obedit, const Image *curimage, const int other_uv_filter) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -536,7 +536,7 @@ static void draw_uvs_texpaint(SpaceImage *sima, Scene *scene, ViewLayer *view_la mloopuv = me->mloopuv; } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -765,7 +765,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje immEnd(); /* Then draw each face contour separately. */ - if (loop_vbo->vertex_ct != 0) { + if (loop_vbo->vertex_len != 0) { GWN_batch_program_use_begin(loop_batch); unsigned int index = 0, loop_vbo_count; BM_ITER_MESH(efa, &iter, bm, BM_FACES_OF_MESH) { @@ -792,7 +792,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje /* Create a color buffer. */ static Gwn_VertFormat format = { 0 }; static uint shdr_col; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { shdr_col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); } diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 9091f3eff0b..c3737787933 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -1567,7 +1567,7 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *ar static Gwn_VertFormat format = { 0 }; static unsigned int pos_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } diff --git a/source/blender/gpu/GPU_framebuffer.h b/source/blender/gpu/GPU_framebuffer.h index 084ee4c0459..ddf485c3c21 100644 --- a/source/blender/gpu/GPU_framebuffer.h +++ b/source/blender/gpu/GPU_framebuffer.h @@ -117,7 +117,7 @@ void GPU_framebuffer_texture_detach_slot( GPU_framebuffer_config_array(*(_fb), config, (sizeof(config) / sizeof(GPUAttachment))); \ } while (0) -void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *config, int config_ct); +void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *config, int config_len); #define GPU_ATTACHMENT_NONE \ {.tex = NULL, .layer = -1, .mip = 0} diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index a65c09152ee..8ddb7b87c4a 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -241,7 +241,7 @@ GPUBuiltin GPU_get_material_builtins(GPUMaterial *material); void GPU_material_sss_profile_create(GPUMaterial *material, float radii[3], short *falloff_type, float *sharpness); struct GPUUniformBuffer *GPU_material_sss_profile_get( - GPUMaterial *material, int sample_ct, struct GPUTexture **tex_profile); + GPUMaterial *material, int sample_len, struct GPUTexture **tex_profile); /* High level functions to create and use GPU materials */ GPUMaterial *GPU_material_from_nodetree_find( diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c index 59d88e81822..6194e720156 100644 --- a/source/blender/gpu/intern/gpu_batch.c +++ b/source/blender/gpu/intern/gpu_batch.c @@ -126,7 +126,7 @@ Gwn_Batch *GPU_batch_tris_from_poly_2d_encoded( /* We have vertices and tris, make a batch from this. */ static Gwn_VertFormat format = {0}; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -230,7 +230,7 @@ Gwn_Batch *GPU_batch_wire_from_poly_2d_encoded( /* We have vertices and tris, make a batch from this. */ static Gwn_VertFormat format = {0}; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } diff --git a/source/blender/gpu/intern/gpu_batch_presets.c b/source/blender/gpu/intern/gpu_batch_presets.c index 10cbd16490b..eaf0a6821ff 100644 --- a/source/blender/gpu/intern/gpu_batch_presets.c +++ b/source/blender/gpu/intern/gpu_batch_presets.c @@ -65,7 +65,7 @@ static ListBase presets_list = {NULL, NULL}; static Gwn_VertFormat *preset_3D_format(void) { - if (g_presets_3d.format.attrib_ct == 0) { + if (g_presets_3d.format.attr_len == 0) { Gwn_VertFormat *format = &g_presets_3d.format; g_presets_3d.attr_id.pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); g_presets_3d.attr_id.nor = GWN_vertformat_attr_add(format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 688386810ea..1a4750652cc 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -126,29 +126,29 @@ static void gpu_material_diffuse_get(int UNUSED(nr), float diff[4]) /* Allocates a non-initialized buffer to be sent to GPU. * Return is false it indicates that the memory map failed. */ -static bool gpu_pbvh_vert_buf_data_set(GPU_PBVH_Buffers *buffers, unsigned int vert_ct) +static bool gpu_pbvh_vert_buf_data_set(GPU_PBVH_Buffers *buffers, unsigned int vert_len) { if (buffers->vert_buf == NULL) { /* Initialize vertex buffer */ /* match 'VertexBufferFormat' */ static Gwn_VertFormat format = {0}; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { g_vbo_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); g_vbo_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I16, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); g_vbo_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); } #if 0 buffers->vert_buf = GWN_vertbuf_create_with_format_ex(&format, GWN_USAGE_DYNAMIC); - GWN_vertbuf_data_alloc(buffers->vert_buf, vert_ct); + GWN_vertbuf_data_alloc(buffers->vert_buf, vert_len); } - else if (vert_ct != buffers->vert_buf->vertex_ct) { - GWN_vertbuf_data_resize(buffers->vert_buf, vert_ct); + else if (vert_len != buffers->vert_buf->vertex_len) { + GWN_vertbuf_data_resize(buffers->vert_buf, vert_len); } #else buffers->vert_buf = GWN_vertbuf_create_with_format_ex(&format, GWN_USAGE_STATIC); } - GWN_vertbuf_data_alloc(buffers->vert_buf, vert_ct); + GWN_vertbuf_data_alloc(buffers->vert_buf, vert_len); #endif return buffers->vert_buf->data != NULL; } diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index eabd501f1d5..ffc72718e42 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -300,7 +300,7 @@ void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex) * Setting GPUAttachment.mip to -1 will leave the texture in this slot. * Setting GPUAttachment.tex to NULL will detach the texture in this slot. **/ -void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *config, int config_ct) +void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *config, int config_len) { if (config[0].tex) { BLI_assert(GPU_texture_depth(config[0].tex)); @@ -317,7 +317,7 @@ void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *confi } int slot = 0; - for (int i = 1; i < config_ct; ++i, ++slot) { + for (int i = 1; i < config_len; ++i, ++slot) { if (config[i].tex != NULL) { BLI_assert(GPU_texture_depth(config[i].tex) == false); gpu_framebuffer_texture_attach_ex(fb, config[i].tex, slot, config[i].layer, config[i].mip); diff --git a/source/blender/gpu/intern/gpu_immediate_util.c b/source/blender/gpu/intern/gpu_immediate_util.c index bad878ef4bf..30672af9c02 100644 --- a/source/blender/gpu/intern/gpu_immediate_util.c +++ b/source/blender/gpu/intern/gpu_immediate_util.c @@ -235,7 +235,7 @@ void imm_draw_box_wire_3d(unsigned pos, float x1, float y1, float x2, float y2) */ void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_CHECKER); immUniform4f("color1", 0.15f, 0.15f, 0.15f, 1.0f); diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index c224e3e0e32..bd0e35f5ab6 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -354,7 +354,7 @@ static float eval_integral(float x0, float x1, short falloff_type, float sharpne #undef INTEGRAL_RESOLUTION static void compute_sss_kernel( - GPUSssKernelData *kd, float radii[3], int sample_ct, int falloff_type, float sharpness) + GPUSssKernelData *kd, float radii[3], int sample_len, int falloff_type, float sharpness) { float rad[3]; /* Minimum radius */ @@ -390,13 +390,13 @@ static void compute_sss_kernel( } /* Compute samples locations on the 1d kernel [-1..1] */ - sss_calculate_offsets(kd, sample_ct, SSS_EXPONENT); + sss_calculate_offsets(kd, sample_len, SSS_EXPONENT); /* Weights sum for normalization */ float sum[3] = {0.0f, 0.0f, 0.0f}; /* Compute integral of each sample footprint */ - for (int i = 0; i < sample_ct; i++) { + for (int i = 0; i < sample_len; i++) { float x0, x1; if (i == 0) { @@ -406,8 +406,8 @@ static void compute_sss_kernel( x0 = (kd->kernel[i - 1][3] + kd->kernel[i][3]) / 2.0f; } - if (i == sample_ct - 1) { - x1 = kd->kernel[sample_ct - 1][3] + fabsf(kd->kernel[sample_ct - 2][3] - kd->kernel[sample_ct - 1][3]) / 2.0f; + if (i == sample_len - 1) { + x1 = kd->kernel[sample_len - 1][3] + fabsf(kd->kernel[sample_len - 2][3] - kd->kernel[sample_len - 1][3]) / 2.0f; } else { x1 = (kd->kernel[i][3] + kd->kernel[i + 1][3]) / 2.0f; @@ -428,25 +428,25 @@ static void compute_sss_kernel( for (int i = 0; i < 3; ++i) { if (sum[i] > 0.0f) { /* Normalize */ - for (int j = 0; j < sample_ct; j++) { + for (int j = 0; j < sample_len; j++) { kd->kernel[j][i] /= sum[i]; } } else { /* Avoid 0 kernel sum. */ - kd->kernel[sample_ct / 2][i] = 1.0f; + kd->kernel[sample_len / 2][i] = 1.0f; } } /* Put center sample at the start of the array (to sample first) */ float tmpv[4]; - copy_v4_v4(tmpv, kd->kernel[sample_ct / 2]); - for (int i = sample_ct / 2; i > 0; i--) { + copy_v4_v4(tmpv, kd->kernel[sample_len / 2]); + for (int i = sample_len / 2; i > 0; i--) { copy_v4_v4(kd->kernel[i], kd->kernel[i - 1]); } copy_v4_v4(kd->kernel[0], tmpv); - kd->samples = sample_ct; + kd->samples = sample_len; } #define INTEGRAL_RESOLUTION 512 @@ -523,12 +523,12 @@ void GPU_material_sss_profile_create(GPUMaterial *material, float radii[3], shor } } -struct GPUUniformBuffer *GPU_material_sss_profile_get(GPUMaterial *material, int sample_ct, GPUTexture **tex_profile) +struct GPUUniformBuffer *GPU_material_sss_profile_get(GPUMaterial *material, int sample_len, GPUTexture **tex_profile) { if (!material->sss_enabled) return NULL; - if (material->sss_dirty || (material->sss_samples != sample_ct)) { + if (material->sss_dirty || (material->sss_samples != sample_len)) { GPUSssKernelData kd; float sharpness = material->sss_sharpness; @@ -536,7 +536,7 @@ struct GPUUniformBuffer *GPU_material_sss_profile_get(GPUMaterial *material, int /* XXX Black magic but it seems to fit. Maybe because we integrate -1..1 */ sharpness *= 0.5f; - compute_sss_kernel(&kd, material->sss_radii, sample_ct, material->sss_falloff, sharpness); + compute_sss_kernel(&kd, material->sss_radii, sample_len, material->sss_falloff, sharpness); /* Update / Create UBO */ GPU_uniformbuffer_update(material->sss_profile, &kd); @@ -553,7 +553,7 @@ struct GPUUniformBuffer *GPU_material_sss_profile_get(GPUMaterial *material, int MEM_freeN(translucence_profile); - material->sss_samples = sample_ct; + material->sss_samples = sample_len; material->sss_dirty = false; } diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index a85a9a9bac3..d9248e06dfb 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -917,12 +917,12 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) Gwn_VertAttr *attr = &format->attribs[0]; /* Detect incompatible cases (not supported by texture buffers) */ - BLI_assert(format->attrib_ct == 1 && vert->vbo_id != 0); - BLI_assert(attr->comp_ct != 3); /* Not until OGL 4.0 */ + BLI_assert(format->attr_len == 1 && vert->vbo_id != 0); + BLI_assert(attr->comp_len != 3); /* Not until OGL 4.0 */ BLI_assert(attr->comp_type != GWN_COMP_I10); BLI_assert(attr->fetch_mode != GWN_FETCH_INT_TO_FLOAT); - unsigned int byte_per_comp = attr->sz / attr->comp_ct; + unsigned int byte_per_comp = attr->sz / attr->comp_len; bool is_uint = ELEM(attr->comp_type, GWN_COMP_U8, GWN_COMP_U16, GWN_COMP_U32); /* Cannot fetch signed int or 32bit ints as normalized float. */ @@ -933,7 +933,7 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) GPUTextureFormat data_type; switch (attr->fetch_mode) { case GWN_FETCH_FLOAT: - switch (attr->comp_ct) { + switch (attr->comp_len) { case 1: data_type = GPU_R32F; break; case 2: data_type = GPU_RG32F; break; // case 3: data_type = GPU_RGB32F; break; /* Not supported */ @@ -941,7 +941,7 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) } break; case GWN_FETCH_INT: - switch (attr->comp_ct) { + switch (attr->comp_len) { case 1: switch (byte_per_comp) { case 1: data_type = (is_uint) ? GPU_R8UI : GPU_R8I; break; @@ -966,7 +966,7 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) } break; case GWN_FETCH_INT_TO_FLOAT_UNIT: - switch (attr->comp_ct) { + switch (attr->comp_len) { case 1: data_type = (byte_per_comp == 1) ? GPU_R8 : GPU_R16; break; case 2: data_type = (byte_per_comp == 1) ? GPU_RG8 : GPU_RG16; break; default: data_type = (byte_per_comp == 1) ? GPU_RGBA8 : GPU_RGBA16; break; diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 5668cf24fe6..331eb216f61 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -179,7 +179,7 @@ typedef struct View3DOverlay { /* Other settings */ float wireframe_threshold; - int object_type_exclude; + char _pad0[4]; } View3DOverlay; @@ -202,6 +202,9 @@ typedef struct View3D { unsigned int lay_prev; /* for active layer toggle */ unsigned int lay_used; /* used while drawing */ + int object_type_exclude_viewport; + int object_type_exclude_select; + short persp DNA_DEPRECATED; short view DNA_DEPRECATED; @@ -358,10 +361,11 @@ enum { V3D_SHADING_OBJECT_OUTLINE = (1 << 0), V3D_SHADING_XRAY = (1 << 1), V3D_SHADING_SHADOW = (1 << 2), - V3D_SHADING_SCENE_LIGHT = (1 << 3), + V3D_SHADING_SCENE_LIGHTS = (1 << 3), V3D_SHADING_SPECULAR_HIGHLIGHT = (1 << 4), V3D_SHADING_CAVITY = (1 << 5), V3D_SHADING_MATCAP_FLIP_X = (1 << 6), + V3D_SHADING_SCENE_WORLD = (1 << 7), }; /* View3DShading->color_type */ diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index bd2811d3306..80ad3840a8f 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -331,6 +331,8 @@ typedef struct wmKeyMap { /* runtime */ /** Verify if enabled in the current context, use #WM_keymap_poll instead of direct calls. */ bool (*poll)(struct bContext *); + bool (*poll_modal_item)(const struct wmOperator *op, int value); + /** For modal, #EnumPropertyItem for now. */ const void *modal_items; } wmKeyMap; diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 06bbde0497c..fe8868235c4 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -69,7 +69,7 @@ extern StructRNA RNA_AnimVizMotionPaths; extern StructRNA RNA_AnimVizOnionSkinning; extern StructRNA RNA_AnyType; extern StructRNA RNA_Area; -extern StructRNA RNA_AreaLamp; +extern StructRNA RNA_AreaLight; extern StructRNA RNA_Armature; extern StructRNA RNA_ArmatureModifier; extern StructRNA RNA_ArmatureSensor; @@ -281,7 +281,7 @@ extern StructRNA RNA_GaussianBlurSequence; extern StructRNA RNA_GlowSequence; extern StructRNA RNA_GreasePencil; extern StructRNA RNA_Header; -extern StructRNA RNA_HemiLamp; +extern StructRNA RNA_HemiLight; extern StructRNA RNA_Histogram; extern StructRNA RNA_HookModifier; extern StructRNA RNA_ID; @@ -312,9 +312,9 @@ extern StructRNA RNA_KeyingSetInfo; extern StructRNA RNA_KeyingSetPath; extern StructRNA RNA_KeyingSetsAll; extern StructRNA RNA_KinematicConstraint; -extern StructRNA RNA_Lamp; -extern StructRNA RNA_LampSkySettings; -extern StructRNA RNA_LampTextureSlot; +extern StructRNA RNA_Light; +extern StructRNA RNA_LightSkySettings; +extern StructRNA RNA_LightTextureSlot; extern StructRNA RNA_LaplacianDeformModifier; extern StructRNA RNA_LaplacianSmoothModifier; extern StructRNA RNA_Lattice; @@ -476,7 +476,7 @@ extern StructRNA RNA_ParticleSystemModifier; extern StructRNA RNA_ParticleTarget; extern StructRNA RNA_PivotConstraint; extern StructRNA RNA_PointCache; -extern StructRNA RNA_PointLamp; +extern StructRNA RNA_PointLight; extern StructRNA RNA_PointerProperty; extern StructRNA RNA_Pose; extern StructRNA RNA_PoseBone; @@ -529,7 +529,7 @@ extern StructRNA RNA_ShaderNodeGeometry; extern StructRNA RNA_ShaderNodeHueSaturation; extern StructRNA RNA_ShaderNodeIESLight; extern StructRNA RNA_ShaderNodeInvert; -extern StructRNA RNA_ShaderNodeLampData; +extern StructRNA RNA_ShaderNodeLightData; extern StructRNA RNA_ShaderNodeMapping; extern StructRNA RNA_ShaderNodeMaterial; extern StructRNA RNA_ShaderNodeMath; @@ -588,7 +588,7 @@ extern StructRNA RNA_Speaker; extern StructRNA RNA_SpeedControlSequence; extern StructRNA RNA_Spline; extern StructRNA RNA_SplineIKConstraint; -extern StructRNA RNA_SpotLamp; +extern StructRNA RNA_SpotLight; extern StructRNA RNA_Stereo3dDisplay; extern StructRNA RNA_StretchToConstraint; extern StructRNA RNA_StringProperty; @@ -596,7 +596,7 @@ extern StructRNA RNA_Struct; extern StructRNA RNA_StucciTexture; extern StructRNA RNA_StudioLight; extern StructRNA RNA_SubsurfModifier; -extern StructRNA RNA_SunLamp; +extern StructRNA RNA_SunLight; extern StructRNA RNA_SurfaceCurve; extern StructRNA RNA_SurfaceDeformModifier; extern StructRNA RNA_SurfaceModifier; diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index ce1edba75fd..bafb2bf5753 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -129,7 +129,7 @@ extern const EnumPropertyItem rna_enum_symmetrize_direction_items[]; extern const EnumPropertyItem rna_enum_texture_type_items[]; -extern const EnumPropertyItem rna_enum_lamp_type_items[]; +extern const EnumPropertyItem rna_enum_light_type_items[]; extern const EnumPropertyItem rna_enum_unpack_method_items[]; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 1dd4535610c..4b06d917ab7 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -3407,7 +3407,7 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_group.c", NULL, RNA_def_collections}, {"rna_image.c", "rna_image_api.c", RNA_def_image}, {"rna_key.c", NULL, RNA_def_key}, - {"rna_lamp.c", NULL, RNA_def_lamp}, + {"rna_lamp.c", NULL, RNA_def_light}, {"rna_lattice.c", "rna_lattice_api.c", RNA_def_lattice}, {"rna_layer.c", NULL, RNA_def_view_layer}, {"rna_linestyle.c", NULL, RNA_def_linestyle}, diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index a2648d7db02..0a294bfaab9 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -61,7 +61,7 @@ const EnumPropertyItem rna_enum_id_type_items[] = { {ID_GR, "COLLECTION", ICON_GROUP, "Collection", ""}, {ID_IM, "IMAGE", ICON_IMAGE_DATA, "Image", ""}, {ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""}, - {ID_LA, "LAMP", ICON_LAMP_DATA, "Lamp", ""}, + {ID_LA, "LIGHT", ICON_LIGHT_DATA, "Light", ""}, {ID_LI, "LIBRARY", ICON_LIBRARY_DATA_DIRECT, "Library", ""}, {ID_LS, "LINESTYLE", ICON_LINE_DATA, "Line Style", ""}, {ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""}, @@ -183,7 +183,7 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_Collection) return ID_GR; if (base_type == &RNA_Image) return ID_IM; if (base_type == &RNA_Key) return ID_KE; - if (base_type == &RNA_Lamp) return ID_LA; + if (base_type == &RNA_Light) return ID_LA; if (base_type == &RNA_Library) return ID_LI; if (base_type == &RNA_FreestyleLineStyle) return ID_LS; if (base_type == &RNA_Lattice) return ID_LT; @@ -227,7 +227,7 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_GR: return &RNA_Collection; case ID_IM: return &RNA_Image; case ID_KE: return &RNA_Key; - case ID_LA: return &RNA_Lamp; + case ID_LA: return &RNA_Light; case ID_LI: return &RNA_Library; case ID_LS: return &RNA_FreestyleLineStyle; case ID_LT: return &RNA_Lattice; diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 638589c104a..7228f4a4683 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -620,7 +620,7 @@ StructRNA *RNA_struct_base(StructRNA *type) /** * Use to find the subtype directly below a base-type. * - * So if type were `RNA_SpotLamp`, `RNA_struct_base_of(type, &RNA_ID)` would return `&RNA_Lamp`. + * So if type were `RNA_SpotLIght`, `RNA_struct_base_of(type, &RNA_ID)` would return `&RNA_Light`. */ const StructRNA *RNA_struct_base_child_of(const StructRNA *type, const StructRNA *parent_type) { diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 97c9d5a9866..12e28d457fb 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -423,10 +423,10 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_icon(prop, ICON_MATERIAL_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - prop = RNA_def_property(srna, "show_lamps", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "show_lights", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAM); - RNA_def_property_ui_text(prop, "Display Lamp", "Include visualization of lamp related animation data"); - RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0); + RNA_def_property_ui_text(prop, "Display Light", "Include visualization of light related animation data"); + RNA_def_property_ui_icon(prop, ICON_LIGHT_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_linestyles", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 8b59d46aaf8..a57777f0630 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -155,7 +155,7 @@ void RNA_def_fcurve(struct BlenderRNA *brna); void RNA_def_gpencil(struct BlenderRNA *brna); void RNA_def_image(struct BlenderRNA *brna); void RNA_def_key(struct BlenderRNA *brna); -void RNA_def_lamp(struct BlenderRNA *brna); +void RNA_def_light(struct BlenderRNA *brna); void RNA_def_lattice(struct BlenderRNA *brna); void RNA_def_linestyle(struct BlenderRNA *brna); void RNA_def_main(struct BlenderRNA *brna); @@ -283,7 +283,7 @@ void rna_TextureSlot_update(struct bContext *C, struct PointerRNA *ptr); bool rna_Armature_object_poll(struct PointerRNA *ptr, struct PointerRNA value); bool rna_Camera_object_poll(struct PointerRNA *ptr, struct PointerRNA value); bool rna_Curve_object_poll(struct PointerRNA *ptr, struct PointerRNA value); -bool rna_Lamp_object_poll(struct PointerRNA *ptr, struct PointerRNA value); +bool rna_Light_object_poll(struct PointerRNA *ptr, struct PointerRNA value); bool rna_Lattice_object_poll(struct PointerRNA *ptr, struct PointerRNA value); bool rna_Mesh_object_poll(struct PointerRNA *ptr, struct PointerRNA value); @@ -354,7 +354,7 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop); -void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop); +void RNA_def_main_lights(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop); diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index dff27e1c625..1fb76a93e27 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -20,7 +20,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/makesrna/intern/rna_lamp.c +/** \file blender/makesrna/intern/rna_light.c * \ingroup RNA */ @@ -54,7 +54,7 @@ #include "WM_api.h" #include "WM_types.h" -static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value) +static void rna_Light_buffer_size_set(PointerRNA *ptr, int value) { Lamp *la = (Lamp *)ptr->data; @@ -63,27 +63,27 @@ static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value) la->bufsize &= (~15); /* round to multiple of 16 */ } -static StructRNA *rna_Lamp_refine(struct PointerRNA *ptr) +static StructRNA *rna_Light_refine(struct PointerRNA *ptr) { Lamp *la = (Lamp *)ptr->data; switch (la->type) { case LA_LOCAL: - return &RNA_PointLamp; + return &RNA_PointLight; case LA_SUN: - return &RNA_SunLamp; + return &RNA_SunLight; case LA_SPOT: - return &RNA_SpotLamp; + return &RNA_SpotLight; case LA_HEMI: - return &RNA_HemiLamp; + return &RNA_HemiLight; case LA_AREA: - return &RNA_AreaLamp; + return &RNA_AreaLight; default: - return &RNA_Lamp; + return &RNA_Light; } } -static void rna_Lamp_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_Light_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Lamp *la = ptr->id.data; @@ -91,7 +91,7 @@ static void rna_Lamp_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN WM_main_add_notifier(NC_LAMP | ND_LIGHTING, la); } -static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_Light_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Lamp *la = ptr->id.data; @@ -99,19 +99,19 @@ static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poin WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, la); } -static void rna_Lamp_use_nodes_update(bContext *C, PointerRNA *ptr) +static void rna_Light_use_nodes_update(bContext *C, PointerRNA *ptr) { Lamp *la = (Lamp *)ptr->data; if (la->use_nodes && la->nodetree == NULL) ED_node_shader_default(C, &la->id); - rna_Lamp_update(CTX_data_main(C), CTX_data_scene(C), ptr); + rna_Light_update(CTX_data_main(C), CTX_data_scene(C), ptr); } #else -/* Don't define icons here, so they don't show up in the Lamp UI (properties Editor) - DingTo */ -const EnumPropertyItem rna_enum_lamp_type_items[] = { +/* Don't define icons here, so they don't show up in the Light UI (properties Editor) - DingTo */ +const EnumPropertyItem rna_enum_light_type_items[] = { {LA_LOCAL, "POINT", 0, "Point", "Omnidirectional point light source"}, {LA_SUN, "SUN", 0, "Sun", "Constant direction parallel ray light source"}, {LA_SPOT, "SPOT", 0, "Spot", "Directional cone light source"}, @@ -120,21 +120,22 @@ const EnumPropertyItem rna_enum_lamp_type_items[] = { {0, NULL, 0, NULL, NULL} }; -static void rna_def_lamp(BlenderRNA *brna) +static void rna_def_light(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - srna = RNA_def_struct(brna, "Lamp", "ID"); - RNA_def_struct_refine_func(srna, "rna_Lamp_refine"); - RNA_def_struct_ui_text(srna, "Lamp", "Lamp data-block for lighting a scene"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_DATA); + srna = RNA_def_struct(brna, "Light", "ID"); + RNA_def_struct_sdna(srna, "Lamp"); + RNA_def_struct_refine_func(srna, "rna_Light_refine"); + RNA_def_struct_ui_text(srna, "Light", "Light data-block for lighting a scene"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_DATA); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_enum_lamp_type_items); - RNA_def_property_ui_text(prop, "Type", "Type of Lamp"); + RNA_def_property_enum_items(prop, rna_enum_light_type_items); + RNA_def_property_ui_text(prop, "Type", "Type of Light"); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_LAMP); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist"); @@ -142,43 +143,43 @@ static void rna_def_lamp(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 1000, 1, 3); RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_range(prop, 0, 10, 1, 3); - RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_ui_text(prop, "Energy", "Amount of light emitted"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Color", "Light color"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "specular_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "spec_fac"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2); RNA_def_property_ui_text(prop, "Specular Factor", "Specular reflection multiplier"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); /* nodes */ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); - RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based lamps"); + RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based lights"); prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the lamp"); - RNA_def_property_update(prop, 0, "rna_Lamp_use_nodes_update"); + RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the light"); + RNA_def_property_update(prop, 0, "rna_Light_use_nodes_update"); /* common */ rna_def_animdata_common(srna); } -static void rna_def_lamp_falloff(StructRNA *srna) +static void rna_def_light_falloff(StructRNA *srna) { PropertyRNA *prop; @@ -195,54 +196,54 @@ static void rna_def_lamp_falloff(StructRNA *srna) prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_fallofftype_items); RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curfalloff"); - RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_ui_text(prop, "Falloff Curve", "Custom light falloff curve"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "att1"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attenuation"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "att2"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attenuation"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "constant_coefficient", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "coeff_const"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Constant Coefficient", "Constant distance attenuation coefficient"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "linear_coefficient", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "coeff_lin"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Linear Coefficient", "Linear distance attenuation coefficient"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "quadratic_coefficient", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "coeff_quad"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Quadratic Coefficient", "Quadratic distance attenuation coefficient"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); } -static void rna_def_lamp_shadow(StructRNA *srna, int sun) +static void rna_def_light_shadow(StructRNA *srna, int sun) { PropertyRNA *prop; prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHADOW); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "bufsize"); @@ -250,66 +251,66 @@ static void rna_def_lamp_shadow(StructRNA *srna, int sun) RNA_def_property_ui_text(prop, "Shadow Buffer Size", "Resolution of the shadow buffer, higher values give crisper shadows " "but use more memory"); - RNA_def_property_int_funcs(prop, NULL, "rna_Lamp_buffer_size_set", NULL); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_int_funcs(prop, NULL, "rna_Light_buffer_size_set", NULL); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Clip Start", "Shadow map clip start, below which objects will not generate shadows"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipend"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Clip End", "Shadow map clip end, beyond which objects will not generate shadows"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bias"); RNA_def_property_range(prop, 0.001f, 9999.0f); RNA_def_property_ui_range(prop, 0.001f, 5.0f, 1.0, 3); RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Bias for reducing self shadowing"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_buffer_bleed_bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bleedbias"); RNA_def_property_range(prop, 0.f, 1.f); RNA_def_property_ui_text(prop, "Shadow Buffer Bleed Bias", "Bias for reducing light-bleed on variance shadow maps"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_buffer_exp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bleedexp"); RNA_def_property_range(prop, 1.0f, 9999.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Exponent", "Bias for reducing light-bleed on exponential shadow maps"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_buffer_soft", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "soft"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Soft", "Size of shadow buffer sampling area"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_buffer_samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samp"); RNA_def_property_range(prop, 1, 16); RNA_def_property_ui_text(prop, "Samples", "Number of shadow buffer samples"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shdwr"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the lamp"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the light"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "area_size"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows)"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); /* Eevee */ prop = RNA_def_property(srna, "use_contact_shadow", PROP_BOOLEAN, PROP_NONE); @@ -317,76 +318,76 @@ static void rna_def_lamp_shadow(StructRNA *srna, int sun) RNA_def_property_ui_text(prop, "Contact Shadow", "Use screen space raytracing to have correct shadowing " "near occluder, or for small features that does not appear " "in shadow maps"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "contact_shadow_distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "contact_dist"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Contact Shadow Distance", "World space distance in which to search for " "screen space occluder"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "contact_shadow_bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "contact_bias"); RNA_def_property_range(prop, 0.001f, 9999.0f); RNA_def_property_ui_range(prop, 0.001f, 5.0f, 1.0, 3); RNA_def_property_ui_text(prop, "Contact Shadow Bias", "Bias to avoid self shadowing"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "contact_shadow_soft_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "contact_spread"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Contact Shadow Soft", "Control how soft the contact shadows will be"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "contact_shadow_thickness", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "contact_thickness"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Contact Shadow Thickness", "Pixel thickness used to detect occlusion"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); if (sun) { prop = RNA_def_property(srna, "shadow_cascade_max_distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "cascade_max_dist"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Cascade Max Distance", "End distance of the cascaded shadow map (only in perspective view)"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_cascade_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "cascade_count"); RNA_def_property_range(prop, 1, 4); RNA_def_property_ui_text(prop, "Cascade Count", "Number of texture used by the cascaded shadow map"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_cascade_exponent", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "cascade_exponent"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Exponential Distribution", "Higher value increase resolution towards the viewpoint"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_cascade_fade", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "cascade_fade"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Cascade Fade", "How smooth is the transition between each cascade"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); } } -static void rna_def_point_lamp(BlenderRNA *brna) +static void rna_def_point_light(BlenderRNA *brna) { StructRNA *srna; - srna = RNA_def_struct(brna, "PointLamp", "Lamp"); + srna = RNA_def_struct(brna, "PointLight", "Light"); RNA_def_struct_sdna(srna, "Lamp"); - RNA_def_struct_ui_text(srna, "Point Lamp", "Omnidirectional point lamp"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_POINT); + RNA_def_struct_ui_text(srna, "Point Light", "Omnidirectional point Light"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_POINT); - rna_def_lamp_falloff(srna); - rna_def_lamp_shadow(srna, 0); + rna_def_light_falloff(srna); + rna_def_light_shadow(srna, 0); } -static void rna_def_area_lamp(BlenderRNA *brna) +static void rna_def_area_light(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -399,103 +400,103 @@ static void rna_def_area_lamp(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - srna = RNA_def_struct(brna, "AreaLamp", "Lamp"); + srna = RNA_def_struct(brna, "AreaLight", "Light"); RNA_def_struct_sdna(srna, "Lamp"); - RNA_def_struct_ui_text(srna, "Area Lamp", "Directional area lamp"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_AREA); + RNA_def_struct_ui_text(srna, "Area Light", "Directional area Light"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_AREA); - rna_def_lamp_shadow(srna, 0); - rna_def_lamp_falloff(srna); + rna_def_light_shadow(srna, 0); + rna_def_light_falloff(srna); prop = RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "area_shape"); RNA_def_property_enum_items(prop, prop_areashape_items); - RNA_def_property_ui_text(prop, "Shape", "Shape of the area lamp"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_ui_text(prop, "Shape", "Shape of the area Light"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "area_size"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); - RNA_def_property_ui_text(prop, "Size", "Size of the area of the area Lamp, X direction size for Rectangle shapes"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_ui_text(prop, "Size", "Size of the area of the area light, X direction size for rectangle shapes"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_float_sdna(prop, NULL, "area_sizey"); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Size Y", - "Size of the area of the area Lamp in the Y direction for Rectangle shapes"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + "Size of the area of the area light in the Y direction for rectangle shapes"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); } -static void rna_def_spot_lamp(BlenderRNA *brna) +static void rna_def_spot_light(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - srna = RNA_def_struct(brna, "SpotLamp", "Lamp"); + srna = RNA_def_struct(brna, "SpotLight", "Light"); RNA_def_struct_sdna(srna, "Lamp"); - RNA_def_struct_ui_text(srna, "Spot Lamp", "Directional cone lamp"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_SPOT); + RNA_def_struct_ui_text(srna, "Spot Light", "Directional cone Light"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_SPOT); - rna_def_lamp_falloff(srna); - rna_def_lamp_shadow(srna, 0); + rna_def_light_falloff(srna); + rna_def_light_shadow(srna, 0); prop = RNA_def_property(srna, "use_square", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE); RNA_def_property_ui_text(prop, "Square", "Cast a square spot light shape"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spotblend"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "spotsize"); RNA_def_property_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f)); RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "show_cone", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHOW_CONE); RNA_def_property_ui_text(prop, "Show Cone", "Draw transparent cone in 3D view to visualize which objects are contained in it"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); } -static void rna_def_sun_lamp(BlenderRNA *brna) +static void rna_def_sun_light(BlenderRNA *brna) { StructRNA *srna; - srna = RNA_def_struct(brna, "SunLamp", "Lamp"); + srna = RNA_def_struct(brna, "SunLight", "Light"); RNA_def_struct_sdna(srna, "Lamp"); - RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN); + RNA_def_struct_ui_text(srna, "Sun Light", "Constant direction parallel ray Light"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_SUN); - rna_def_lamp_shadow(srna, 1); + rna_def_light_shadow(srna, 1); } -static void rna_def_hemi_lamp(BlenderRNA *brna) +static void rna_def_hemi_light(BlenderRNA *brna) { StructRNA *srna; - srna = RNA_def_struct(brna, "HemiLamp", "Lamp"); + srna = RNA_def_struct(brna, "HemiLight", "Light"); RNA_def_struct_sdna(srna, "Lamp"); - RNA_def_struct_ui_text(srna, "Hemi Lamp", "180 degree constant lamp"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_HEMI); + RNA_def_struct_ui_text(srna, "Hemi Light", "180 degree constant Light"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_HEMI); } -void RNA_def_lamp(BlenderRNA *brna) +void RNA_def_light(BlenderRNA *brna) { - rna_def_lamp(brna); - rna_def_point_lamp(brna); - rna_def_area_lamp(brna); - rna_def_spot_lamp(brna); - rna_def_sun_lamp(brna); - rna_def_hemi_lamp(brna); + rna_def_light(brna); + rna_def_point_light(brna); + rna_def_area_light(brna); + rna_def_spot_light(brna); + rna_def_sun_light(brna); + rna_def_hemi_light(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index f3921545ac5..5e05d37dc8c 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -107,7 +107,7 @@ static void rna_Main_object_begin(CollectionPropertyIterator *iter, PointerRNA * rna_iterator_listbase_begin(iter, &bmain->object, NULL); } -static void rna_Main_lamp_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_light_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->lamp, NULL); @@ -353,7 +353,7 @@ void RNA_def_main(BlenderRNA *brna) {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material data-blocks", RNA_def_main_materials}, {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group data-blocks", RNA_def_main_node_groups}, {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh data-blocks", RNA_def_main_meshes}, - {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp data-blocks", RNA_def_main_lamps}, + {"lights", "Light", "rna_Main_light_begin", "Lights", "Light data-blocks", RNA_def_main_lights}, {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library data-blocks", RNA_def_main_libraries}, {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen data-blocks", RNA_def_main_screens}, {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager data-blocks", RNA_def_main_window_managers}, diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 5fca91064b6..febe74f63c9 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -319,7 +319,7 @@ Mesh *rna_Main_meshes_new_from_object( return BKE_mesh_new_from_object(depsgraph, bmain, sce, ob, apply_modifiers, calc_tessface, calc_undeformed); } -static Lamp *rna_Main_lamps_new(Main *bmain, const char *name, int type) +static Lamp *rna_Main_lights_new(Main *bmain, const char *name, int type) { char safe_name[MAX_ID_NAME - 2]; rna_idname_validate(name, safe_name); @@ -603,7 +603,7 @@ RNA_MAIN_ID_TAG_FUNCS_DEF(objects, object, ID_OB) RNA_MAIN_ID_TAG_FUNCS_DEF(materials, mat, ID_MA) RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetree, ID_NT) RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, mesh, ID_ME) -RNA_MAIN_ID_TAG_FUNCS_DEF(lamps, lamp, ID_LA) +RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lamp, ID_LA) RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, library, ID_LI) RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screen, ID_SCR) RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm, ID_WM) @@ -894,42 +894,43 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop) parm = RNA_def_boolean(func, "value", 0, "Value", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); } -void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop) + +void RNA_def_main_lights(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; FunctionRNA *func; PropertyRNA *parm; - RNA_def_property_srna(cprop, "BlendDataLamps"); - srna = RNA_def_struct(brna, "BlendDataLamps", NULL); + RNA_def_property_srna(cprop, "BlendDataLights"); + srna = RNA_def_struct(brna, "BlendDataLights", NULL); RNA_def_struct_sdna(srna, "Main"); - RNA_def_struct_ui_text(srna, "Main Lamps", "Collection of lamps"); + RNA_def_struct_ui_text(srna, "Main Lights", "Collection of lights"); - func = RNA_def_function(srna, "new", "rna_Main_lamps_new"); - RNA_def_function_ui_description(func, "Add a new lamp to the main database"); - parm = RNA_def_string(func, "name", "Lamp", 0, "", "New name for the data-block"); + func = RNA_def_function(srna, "new", "rna_Main_lights_new"); + RNA_def_function_ui_description(func, "Add a new light to the main database"); + parm = RNA_def_string(func, "name", "Light", 0, "", "New name for the data-block"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - parm = RNA_def_enum(func, "type", rna_enum_lamp_type_items, 0, "Type", "The type of texture to add"); + parm = RNA_def_enum(func, "type", rna_enum_light_type_items, 0, "Type", "The type of texture to add"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); /* return type */ - parm = RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp data-block"); + parm = RNA_def_pointer(func, "light", "Light", "", "New light data-block"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_Main_ID_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile"); - parm = RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove"); + RNA_def_function_ui_description(func, "Remove a light from the current blendfile"); + parm = RNA_def_pointer(func, "light", "Light", "", "Light to remove"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); RNA_def_boolean(func, "do_unlink", true, "", - "Unlink all usages of this lamp before deleting it " - "(WARNING: will also delete objects instancing that lamp data)"); + "Unlink all usages of this Light before deleting it " + "(WARNING: will also delete objects instancing that light data)"); RNA_def_boolean(func, "do_id_user", true, "", - "Decrement user counter of all datablocks used by this lamp data"); + "Decrement user counter of all datablocks used by this light data"); RNA_def_boolean(func, "do_ui_user", true, "", - "Make sure interface does not reference this lamp data"); + "Make sure interface does not reference this light data"); - func = RNA_def_function(srna, "tag", "rna_Main_lamps_tag"); + func = RNA_def_function(srna, "tag", "rna_Main_lights_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); } diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 46022511f8e..50246c3f9ac 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1309,7 +1309,7 @@ static void rna_def_modifier_warp(BlenderRNA *brna) prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curfalloff"); - RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve"); + RNA_def_property_ui_text(prop, "Falloff Curve", "Custom falloff curve"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "use_volume_preserve", PROP_BOOLEAN, PROP_NONE); @@ -1900,7 +1900,7 @@ static void rna_def_modifier_hook(BlenderRNA *brna) prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curfalloff"); - RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve"); + RNA_def_property_ui_text(prop, "Falloff Curve", "Custom falloff curve"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "center", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 8ffcb85deed..89ca6b52c75 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -7756,12 +7756,6 @@ static void rna_def_node(BlenderRNA *brna) {NODE_CUSTOM, "CUSTOM", 0, "Custom", "Custom Node"}, {0, NULL, 0, NULL, NULL}}; - static const EnumPropertyItem node_shading_compatibilities[] = { - {NODE_OLD_SHADING, "OLD_SHADING", 0, "Old Shading", "Old shading system compatibility"}, - {NODE_NEW_SHADING, "NEW_SHADING", 0, "New Shading", "New shading system compatibility"}, - {0, NULL, 0, NULL, NULL} - }; - srna = RNA_def_struct(brna, "Node", NULL); RNA_def_struct_ui_text(srna, "Node", "Node in a node tree"); RNA_def_struct_sdna(srna, "bNode"); @@ -7901,12 +7895,6 @@ static void rna_def_node(BlenderRNA *brna) parm = RNA_def_boolean(func, "result", false, "Result", ""); RNA_def_function_return(func, parm); - prop = RNA_def_property(srna, "shading_compatibility", PROP_ENUM, PROP_NONE); - RNA_def_property_flag(prop, PROP_ENUM_FLAG); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_enum_sdna(prop, NULL, "typeinfo->compatibility"); - RNA_def_property_enum_items(prop, node_shading_compatibilities); - /* registration */ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "typeinfo->idname"); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 04f4c41659d..2bdfbade53a 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -146,7 +146,7 @@ const EnumPropertyItem rna_enum_object_type_items[] = { {OB_EMPTY, "EMPTY", 0, "Empty", ""}, {0, "", 0, NULL, NULL}, {OB_CAMERA, "CAMERA", 0, "Camera", ""}, - {OB_LAMP, "LAMP", 0, "Lamp", ""}, + {OB_LAMP, "LIGHT", 0, "Light", ""}, {OB_SPEAKER, "SPEAKER", 0, "Speaker", ""}, {OB_LIGHTPROBE, "LIGHT_PROBE", 0, "Probe", ""}, {0, NULL, 0, NULL, NULL} @@ -375,7 +375,7 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr) case OB_SURF: return &RNA_Curve; case OB_FONT: return &RNA_Curve; case OB_MBALL: return &RNA_MetaBall; - case OB_LAMP: return &RNA_Lamp; + case OB_LAMP: return &RNA_Light; case OB_CAMERA: return &RNA_Camera; case OB_LATTICE: return &RNA_Lattice; case OB_ARMATURE: return &RNA_Armature; @@ -1446,7 +1446,7 @@ bool rna_Camera_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) return ((Object *)value.id.data)->type == OB_CAMERA; } -bool rna_Lamp_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) +bool rna_Light_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) { return ((Object *)value.id.data)->type == OB_LAMP; } diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index b902fa73334..1a2b3854668 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -517,7 +517,7 @@ void RNA_api_object(StructRNA *srna) /* Camera-related operations */ func = RNA_def_function(srna, "calc_matrix_camera", "rna_Object_calc_matrix_camera"); RNA_def_function_ui_description(func, "Generate the camera projection matrix of this object " - "(mostly useful for Camera and Lamp types)"); + "(mostly useful for Camera and Light types)"); parm = RNA_def_pointer(func, "depsgraph", "Depsgraph", "", "Depsgraph to get evaluated data from"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index d6b70bef1d9..20203492990 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -5984,7 +5984,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna) prop = RNA_def_property(srna, "use_volumetric_lights", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_VOLUMETRIC_LIGHTS); RNA_def_property_boolean_default(prop, 1); - RNA_def_property_ui_text(prop, "Volumetric Lighting", "Enable scene lamps interactions with volumetrics"); + RNA_def_property_ui_text(prop, "Volumetric Lighting", "Enable scene light interactions with volumetrics"); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE); @@ -6148,13 +6148,13 @@ static void rna_def_scene_eevee(BlenderRNA *brna) prop = RNA_def_property(srna, "shadow_cube_size", PROP_ENUM, PROP_NONE); RNA_def_property_enum_default(prop, 512); RNA_def_property_enum_items(prop, eevee_shadow_size_items); - RNA_def_property_ui_text(prop, "Cube Shadows Resolution", "Size of point and area lamps shadow maps"); + RNA_def_property_ui_text(prop, "Cube Shadows Resolution", "Size of point and area light shadow maps"); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); prop = RNA_def_property(srna, "shadow_cascade_size", PROP_ENUM, PROP_NONE); RNA_def_property_enum_default(prop, 1024); RNA_def_property_enum_items(prop, eevee_shadow_size_items); - RNA_def_property_ui_text(prop, "Directional Shadows Resolution", "Size of sun lamps shadow maps"); + RNA_def_property_ui_text(prop, "Directional Shadows Resolution", "Size of sun light shadow maps"); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); prop = RNA_def_property(srna, "use_shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 2a7bb5994c3..ab83cedd232 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -800,8 +800,13 @@ static int rna_View3DShading_studio_light_get(PointerRNA *ptr) flag = STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE; } StudioLight *sl = BKE_studiolight_find(dna_storage, flag); - BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE); - return sl->index; + if (sl) { + BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE); + return sl->index; + } + else { + return 0; + } } static void rna_View3DShading_studio_light_set(PointerRNA *ptr, int value) @@ -818,7 +823,9 @@ static void rna_View3DShading_studio_light_set(PointerRNA *ptr, int value) flag = STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE; } StudioLight *sl = BKE_studiolight_findindex(value, flag); - BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE); + if (sl) { + BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE); + } } static const EnumPropertyItem *rna_View3DShading_studio_light_itemf( @@ -846,8 +853,10 @@ static const EnumPropertyItem *rna_View3DShading_studio_light_itemf( bool show_studiolight = false; if (sl->flag & STUDIOLIGHT_INTERNAL) { - /* always show internal lights */ - show_studiolight = true; + /* always show internal lights for solid */ + if (v3d->drawtype == OB_SOLID) { + show_studiolight = true; + } } else { switch (v3d->drawtype) { @@ -1320,7 +1329,7 @@ static const EnumPropertyItem *rna_SpaceProperties_context_itemf( static void rna_SpaceProperties_context_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { SpaceButs *sbuts = (SpaceButs *)(ptr->data); - /* XXX BCONTEXT_DATA is ugly, but required for lamps... See T51318. */ + /* XXX BCONTEXT_DATA is ugly, but required for lights... See T51318. */ if (ELEM(sbuts->mainb, BCONTEXT_WORLD, BCONTEXT_MATERIAL, BCONTEXT_TEXTURE, BCONTEXT_DATA)) { sbuts->preview = 1; } @@ -2339,9 +2348,9 @@ static void rna_def_space_outliner(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Empties", "Show empty objects"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); - prop = RNA_def_property(srna, "use_filter_object_lamp", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "use_filter_object_light", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_LAMP); - RNA_def_property_ui_text(prop, "Show Lamps", "Show lamps objects"); + RNA_def_property_ui_text(prop, "Show Lights", "Show light objects"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); prop = RNA_def_property(srna, "use_filter_object_camera", PROP_BOOLEAN, PROP_NONE); @@ -2479,10 +2488,16 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "use_scene_light", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "shading.flag", V3D_SHADING_SCENE_LIGHT); + prop = RNA_def_property(srna, "use_scene_lights", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "shading.flag", V3D_SHADING_SCENE_LIGHTS); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Scene Lights", "Render lights and light probes of the scene"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "use_scene_world", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "shading.flag", V3D_SHADING_SCENE_WORLD); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Scene Light", "Render lamps and light probes of the scene"); + RNA_def_property_ui_text(prop, "Scene World", "Use scene world for lighting"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "show_specular_highlight", PROP_BOOLEAN, PROP_NONE); @@ -2609,16 +2624,6 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show 3D Cursor", "Display 3D Cursor Overlay"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_non_geometry", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna( - prop, NULL, "overlay.object_type_exclude", - ((1 << OB_TYPE_MAX) - 1) & - ~((1 << OB_MESH) | (1 << OB_CURVE) | (1 << OB_SURF) | (1 << OB_FONT) | (1 << OB_MBALL))); - RNA_def_property_boolean_default(prop, true); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Show Non Renderable", "Draw not renderable objects in the overlay"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_text", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "overlay.flag", V3D_OVERLAY_HIDE_TEXT); RNA_def_property_ui_text(prop, "Show Text", "Display overlay text"); @@ -3024,6 +3029,54 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Volume Alpha", "Opacity (alpha) of the cameras' frustum volume"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + { + struct { + const char *name; + int type_mask; + const char *identifier[2]; + } info[] = { + {"Mesh", (1 << OB_MESH), + {"show_object_viewport_mesh", "show_object_select_mesh"}}, + {"Curve", (1 << OB_CURVE), + {"show_object_viewport_curve", "show_object_select_curve"}}, + {"Surface", (1 << OB_SURF), + {"show_object_viewport_surf", "show_object_select_surf"}}, + {"Meta", (1 << OB_MBALL), + {"show_object_viewport_meta", "show_object_select_meta"}}, + {"Font", (1 << OB_FONT), + {"show_object_viewport_font", "show_object_select_font"}}, + {"Armature", (1 << OB_ARMATURE), + {"show_object_viewport_armature", "show_object_select_armature"}}, + {"Lattice", (1 << OB_LATTICE), + {"show_object_viewport_lattice", "show_object_select_lattice"}}, + {"Empty", (1 << OB_EMPTY), + {"show_object_viewport_empty", "show_object_select_empty"}}, + {"Camera", (1 << OB_CAMERA), + {"show_object_viewport_camera", "show_object_select_camera"}}, + {"Lamp", (1 << OB_LAMP), + {"show_object_viewport_lamp", "show_object_select_lamp"}}, + {"Speaker", (1 << OB_SPEAKER), + {"show_object_viewport_speaker", "show_object_select_speaker"}}, + {"Light Probe", (1 << OB_LIGHTPROBE), + {"show_object_viewport_light_probe", "show_object_select_light_probe"}}, + }; + + const char *view_mask_member[2] = { + "object_type_exclude_viewport", + "object_type_exclude_select", + }; + for (int mask_index = 0; mask_index < 2; mask_index++) { + for (int type_index = 0; type_index < ARRAY_SIZE(info); type_index++) { + prop = RNA_def_property(srna, info[type_index].identifier[mask_index], PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna( + prop, NULL, view_mask_member[mask_index], info[type_index].type_mask); + RNA_def_property_ui_text(prop, info[type_index].name, ""); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + + } + } + } + /* Nested Structs */ prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -4047,7 +4100,7 @@ static void rna_def_fileselect_params(BlenderRNA *brna) {FILTER_ID_GD, "GREASE_PENCIL", ICON_GREASEPENCIL, "Grease Pencil", "Show/hide Grease pencil data-blocks"}, {FILTER_ID_GR, "GROUP", ICON_GROUP, "Groups", "Show/hide Group data-blocks"}, {FILTER_ID_IM, "IMAGE", ICON_IMAGE_DATA, "Images", "Show/hide Image data-blocks"}, - {FILTER_ID_LA, "LAMP", ICON_LAMP_DATA, "Lamps", "Show/hide Lamp data-blocks"}, + {FILTER_ID_LA, "LIGHT", ICON_LIGHT_DATA, "Lights", "Show/hide Light data-blocks"}, {FILTER_ID_LS, "LINESTYLE", ICON_LINE_DATA, "Freestyle Linestyles", "Show/hide Freestyle's Line Style data-blocks"}, {FILTER_ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattices", "Show/hide Lattice data-blocks"}, @@ -4089,7 +4142,7 @@ static void rna_def_fileselect_params(BlenderRNA *brna) {FILTER_ID_IM | FILTER_ID_MC | FILTER_ID_MSK | FILTER_ID_SO, "IMAGE", ICON_IMAGE_DATA, "Images & Sounds", "Show/hide images, movie clips, sounds and masks"}, {FILTER_ID_CA | FILTER_ID_LA | FILTER_ID_SPK | FILTER_ID_WO | FILTER_ID_WS, - "ENVIRONMENT", ICON_WORLD_DATA, "Environment", "Show/hide worlds, lamps, cameras and speakers"}, + "ENVIRONMENT", ICON_WORLD_DATA, "Environment", "Show/hide worlds, lights, cameras and speakers"}, {FILTER_ID_BR | FILTER_ID_GD | FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_CF, "MISC", ICON_GREASEPENCIL, "Miscellaneous", "Show/hide other data types"}, {0, NULL, 0, NULL, NULL} diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 0026344e460..07fd20c6fc5 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1435,7 +1435,7 @@ static void rna_def_texture(BlenderRNA *brna) srna = RNA_def_struct(brna, "Texture", "ID"); RNA_def_struct_sdna(srna, "Tex"); - RNA_def_struct_ui_text(srna, "Texture", "Texture data-block used by materials, lamps, worlds and brushes"); + RNA_def_struct_ui_text(srna, "Texture", "Texture data-block used by materials, lights, worlds and brushes"); RNA_def_struct_ui_icon(srna, ICON_TEXTURE_DATA); RNA_def_struct_refine_func(srna, "rna_Texture_refine"); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index be8bce61910..74117b43d91 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -844,7 +844,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_function_return(func, parm); func = RNA_def_function(srna, "template_preview", "uiTemplatePreview"); - RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps or worlds"); + RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lights or worlds"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); parm = RNA_def_pointer(func, "id", "ID", "", "ID data-block"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); @@ -856,7 +856,7 @@ void RNA_api_ui_layout(StructRNA *srna) "(i.e. all previews of materials without explicit ID will have the same size...)"); func = RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping"); - RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps"); + RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lights"); api_ui_item_rna_common(func); RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display"); RNA_def_boolean(func, "levels", false, "", "Show black/white levels"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 9cde04c560e..9ac93efe347 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1805,9 +1805,10 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Empty", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR_GAMMA); + prop = RNA_def_property(srna, "light", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "lamp"); RNA_def_property_array(prop, 4); - RNA_def_property_ui_text(prop, "Lamp", ""); + RNA_def_property_ui_text(prop, "Light", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop = RNA_def_property(srna, "speaker", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -3803,7 +3804,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop = RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "obcenter_dia"); RNA_def_property_range(prop, 4, 10); - RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Lamp origin display"); + RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Light origin display"); RNA_def_property_update(prop, 0, "rna_userdef_update"); /* View2D Grid Displays */ @@ -4038,9 +4039,9 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM); RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object"); - prop = RNA_def_property(srna, "use_duplicate_lamp", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "use_duplicate_light", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP); - RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object"); + RNA_def_property_ui_text(prop, "Duplicate Light", "Causes light data to be duplicated with the object"); prop = RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT); diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h index ec4e88768de..cf974132961 100644 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@ -62,8 +62,8 @@ DefNode( ShaderNode, SH_NODE_COMBRGB, 0, "COMBR DefNode( ShaderNode, SH_NODE_HUE_SAT, 0, "HUE_SAT", HueSaturation, "Hue/Saturation", "" ) DefNode( ShaderNode, SH_NODE_OUTPUT_MATERIAL, def_sh_output, "OUTPUT_MATERIAL", OutputMaterial, "Material Output", "" ) -DefNode( ShaderNode, SH_NODE_EEVEE_SPECULAR, 0, "EEVEE_SPECULAR", EeveeSpecular, "Specular", "") -DefNode( ShaderNode, SH_NODE_OUTPUT_LAMP, def_sh_output, "OUTPUT_LAMP", OutputLamp, "Lamp Output", "" ) +DefNode( ShaderNode, SH_NODE_EEVEE_SPECULAR, 0, "EEVEE_SPECULAR", EeveeSpecular, "Specular", "" ) +DefNode( ShaderNode, SH_NODE_OUTPUT_LIGHT, def_sh_output, "OUTPUT_LIGHT", OutputLight, "Light Output", "" ) DefNode( ShaderNode, SH_NODE_OUTPUT_WORLD, def_sh_output, "OUTPUT_WORLD", OutputWorld, "World Output", "" ) DefNode( ShaderNode, SH_NODE_OUTPUT_LINESTYLE, def_sh_output_linestyle,"OUTPUT_LINESTYLE", OutputLineStyle, "Line Style Output", "" ) DefNode( ShaderNode, SH_NODE_FRESNEL, 0, "FRESNEL", Fresnel, "Fresnel", "" ) diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c index cb04b341c26..2dbb573f305 100644 --- a/source/blender/nodes/intern/node_common.c +++ b/source/blender/nodes/intern/node_common.c @@ -210,7 +210,6 @@ void register_node_type_frame(void) node_type_init(ntype, node_frame_init); node_type_storage(ntype, "NodeFrame", node_free_standard_storage, node_copy_standard_storage); node_type_size(ntype, 150, 100, 0); - node_type_compatibility(ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); ntype->needs_free = 1; nodeRegisterType(ntype); @@ -484,7 +483,6 @@ void register_node_type_group_input(void) node_type_size(ntype, 140, 80, 400); node_type_init(ntype, node_group_input_init); node_type_update(ntype, node_group_input_update, node_group_input_verify); - node_type_compatibility(ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); ntype->needs_free = 1; nodeRegisterType(ntype); @@ -583,7 +581,6 @@ void register_node_type_group_output(void) node_type_size(ntype, 140, 80, 400); node_type_init(ntype, node_group_output_init); node_type_update(ntype, node_group_output_update, node_group_output_verify); - node_type_compatibility(ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); ntype->needs_free = 1; nodeRegisterType(ntype); diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c index 8db88f13ea6..32c9244735d 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -222,7 +222,7 @@ bNode *ntreeShaderOutputNode(bNodeTree *ntree, int target) for (bNode *node = ntree->nodes.first; node; node = node->next) { if (!ELEM(node->type, SH_NODE_OUTPUT_MATERIAL, SH_NODE_OUTPUT_WORLD, - SH_NODE_OUTPUT_LAMP)) + SH_NODE_OUTPUT_LIGHT)) { continue; } diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c index 1ae50dab358..9190f0d53cd 100644 --- a/source/blender/nodes/shader/node_shader_util.c +++ b/source/blender/nodes/shader/node_shader_util.c @@ -226,9 +226,8 @@ void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, int do_outputs) do_it = false; /* for groups, only execute outputs for edited group */ if (node->typeinfo->nclass == NODE_CLASS_OUTPUT) { - if (node->typeinfo->compatibility & NODE_NEW_SHADING) - if (do_outputs && (node->flag & NODE_DO_OUTPUT)) - do_it = true; + if (do_outputs && (node->flag & NODE_DO_OUTPUT)) + do_it = true; } else { do_it = true; diff --git a/source/blender/nodes/shader/nodes/node_shader_add_shader.c b/source/blender/nodes/shader/nodes/node_shader_add_shader.c index d3bb8fccf71..0661ab59434 100644 --- a/source/blender/nodes/shader/nodes/node_shader_add_shader.c +++ b/source/blender/nodes/shader/nodes/node_shader_add_shader.c @@ -51,7 +51,6 @@ void register_node_type_sh_add_shader(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_ADD_SHADER, "Add Shader", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_add_shader_in, sh_node_add_shader_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c b/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c index 4c770984717..76ef257f8a3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c +++ b/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c @@ -62,7 +62,6 @@ void register_node_type_sh_ambient_occlusion(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_AMBIENT_OCCLUSION, "Ambient Occlusion", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_ambient_occlusion_in, sh_node_ambient_occlusion_out); node_type_init(&ntype, node_shader_init_ambient_occlusion); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_attribute.c b/source/blender/nodes/shader/nodes/node_shader_attribute.c index 05091a2709a..aca72ac27cc 100644 --- a/source/blender/nodes/shader/nodes/node_shader_attribute.c +++ b/source/blender/nodes/shader/nodes/node_shader_attribute.c @@ -76,7 +76,6 @@ void register_node_type_sh_attribute(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_ATTRIBUTE, "Attribute", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_attribute_out); node_type_init(&ntype, node_shader_init_attribute); node_type_storage(&ntype, "NodeShaderAttribute", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_background.c b/source/blender/nodes/shader/nodes/node_shader_background.c index 4ea675f9e0c..38b5883bc1e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_background.c +++ b/source/blender/nodes/shader/nodes/node_shader_background.c @@ -51,7 +51,6 @@ void register_node_type_sh_background(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BACKGROUND, "Background", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_background_in, sh_node_background_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bevel.c b/source/blender/nodes/shader/nodes/node_shader_bevel.c index dd9bc91e2d1..05161bd453a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bevel.c +++ b/source/blender/nodes/shader/nodes/node_shader_bevel.c @@ -60,7 +60,6 @@ void register_node_type_sh_bevel(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BEVEL, "Bevel", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bevel_in, sh_node_bevel_out); node_type_init(&ntype, node_shader_init_bevel); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_blackbody.c b/source/blender/nodes/shader/nodes/node_shader_blackbody.c index 7bdce077977..76291df41bc 100644 --- a/source/blender/nodes/shader/nodes/node_shader_blackbody.c +++ b/source/blender/nodes/shader/nodes/node_shader_blackbody.c @@ -54,7 +54,6 @@ void register_node_type_sh_blackbody(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BLACKBODY, "Blackbody", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_socket_templates(&ntype, sh_node_blackbody_in, sh_node_blackbody_out); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_brightness.c b/source/blender/nodes/shader/nodes/node_shader_brightness.c index bb95ed2d32c..d17a5b9ba6e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_brightness.c +++ b/source/blender/nodes/shader/nodes/node_shader_brightness.c @@ -52,7 +52,6 @@ void register_node_type_sh_brightcontrast(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_brightcontrast_in, sh_node_brightcontrast_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c index ee3db99d2ab..c1423867d96 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c @@ -63,7 +63,6 @@ void register_node_type_sh_bsdf_anisotropic(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_ANISOTROPIC, "Anisotropic BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_anisotropic_in, sh_node_bsdf_anisotropic_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_anisotropic); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c index be7012712cc..58a37b0e81d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c @@ -55,7 +55,6 @@ void register_node_type_sh_bsdf_diffuse(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_DIFFUSE, "Diffuse BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_diffuse_in, sh_node_bsdf_diffuse_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c index 3d3173f6862..7b060bc68aa 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c @@ -61,7 +61,6 @@ void register_node_type_sh_bsdf_glass(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_GLASS, "Glass BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_glass_in, sh_node_bsdf_glass_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_glass); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c index eb5bd7b57d8..c3fb43c0ce8 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c @@ -60,7 +60,6 @@ void register_node_type_sh_bsdf_glossy(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_GLOSSY, "Glossy BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_glossy_in, sh_node_bsdf_glossy_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_glossy); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.c index 9db0e3284b9..d97344ad6a7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.c @@ -54,7 +54,6 @@ void register_node_type_sh_bsdf_hair(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_HAIR, "Hair BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_hair_in, sh_node_bsdf_hair_out); node_type_size(&ntype, 150, 60, 200); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c index b4a83c847be..7f02295d45f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c @@ -143,7 +143,6 @@ void register_node_type_sh_bsdf_principled(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_PRINCIPLED, "Principled BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_principled_in, sh_node_bsdf_principled_out); node_type_size_preset(&ntype, NODE_SIZE_LARGE); node_type_init(&ntype, node_shader_init_principled); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c index 949f6a90de5..41dd3f8af3c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c @@ -61,7 +61,6 @@ void register_node_type_sh_bsdf_refraction(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_REFRACTION, "Refraction BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_refraction_in, sh_node_bsdf_refraction_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_refraction); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c index 0470795930b..0754a7e5a3b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c @@ -58,7 +58,6 @@ void register_node_type_sh_bsdf_toon(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_TOON, "Toon BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_toon_in, sh_node_bsdf_toon_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c index 7757ae38efd..2c0949f275c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c @@ -54,7 +54,6 @@ void register_node_type_sh_bsdf_translucent(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_TRANSLUCENT, "Translucent BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_translucent_in, sh_node_bsdf_translucent_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c index 441a7c50305..08ddf221804 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c @@ -50,7 +50,6 @@ void register_node_type_sh_bsdf_transparent(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_TRANSPARENT, "Transparent BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_transparent_in, sh_node_bsdf_transparent_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c index fec106a131a..ce331f03d4e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c @@ -55,7 +55,6 @@ void register_node_type_sh_bsdf_velvet(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_VELVET, "Velvet BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_velvet_in, sh_node_bsdf_velvet_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bump.c b/source/blender/nodes/shader/nodes/node_shader_bump.c index 6274d132bc7..08b50a886c5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bump.c +++ b/source/blender/nodes/shader/nodes/node_shader_bump.c @@ -68,7 +68,6 @@ void register_node_type_sh_bump(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BUMP, "Bump", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bump_in, sh_node_bump_out); node_type_storage(&ntype, "", NULL, NULL); node_type_gpu(&ntype, gpu_shader_bump); diff --git a/source/blender/nodes/shader/nodes/node_shader_camera.c b/source/blender/nodes/shader/nodes/node_shader_camera.c index dfd712afb29..9089d415759 100644 --- a/source/blender/nodes/shader/nodes/node_shader_camera.c +++ b/source/blender/nodes/shader/nodes/node_shader_camera.c @@ -54,7 +54,6 @@ void register_node_type_sh_camera(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_CAMERA, "Camera Data", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_camera_out); node_type_storage(&ntype, "", NULL, NULL); node_type_gpu(&ntype, gpu_shader_camera); diff --git a/source/blender/nodes/shader/nodes/node_shader_common.c b/source/blender/nodes/shader/nodes/node_shader_common.c index 09fc10a4c71..23b27fc5008 100644 --- a/source/blender/nodes/shader/nodes/node_shader_common.c +++ b/source/blender/nodes/shader/nodes/node_shader_common.c @@ -238,7 +238,6 @@ void register_node_type_sh_group(void) BLI_assert(ntype.ext.srna != NULL); RNA_struct_blender_type_set(ntype.ext.srna, &ntype); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, NULL); node_type_size(&ntype, 140, 60, 400); node_type_label(&ntype, node_group_label); diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.c b/source/blender/nodes/shader/nodes/node_shader_curves.c index 4f3dc92ad02..d5932ff233a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_curves.c +++ b/source/blender/nodes/shader/nodes/node_shader_curves.c @@ -74,7 +74,6 @@ void register_node_type_sh_curve_vec(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_curve_vec_in, sh_node_curve_vec_out); node_type_init(&ntype, node_shader_init_curve_vec); node_type_size_preset(&ntype, NODE_SIZE_LARGE); @@ -133,7 +132,6 @@ void register_node_type_sh_curve_rgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_curve_rgb_in, sh_node_curve_rgb_out); node_type_init(&ntype, node_shader_init_curve_rgb); node_type_size_preset(&ntype, NODE_SIZE_LARGE); diff --git a/source/blender/nodes/shader/nodes/node_shader_displacement.c b/source/blender/nodes/shader/nodes/node_shader_displacement.c index c26968e8d14..4480cbdf56b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_displacement.c +++ b/source/blender/nodes/shader/nodes/node_shader_displacement.c @@ -74,7 +74,6 @@ void register_node_type_sh_displacement(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_DISPLACEMENT, "Displacement", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_displacement_in, sh_node_displacement_out); node_type_storage(&ntype, "", NULL, NULL); node_type_init(&ntype, node_shader_init_displacement); diff --git a/source/blender/nodes/shader/nodes/node_shader_eevee_specular.c b/source/blender/nodes/shader/nodes/node_shader_eevee_specular.c index cd912a4b4cb..e05b0be1e62 100644 --- a/source/blender/nodes/shader/nodes/node_shader_eevee_specular.c +++ b/source/blender/nodes/shader/nodes/node_shader_eevee_specular.c @@ -77,7 +77,6 @@ void register_node_type_sh_eevee_specular(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_EEVEE_SPECULAR, "Specular", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_eevee_specular_in, sh_node_eevee_specular_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_emission.c b/source/blender/nodes/shader/nodes/node_shader_emission.c index f2ab4a119da..7a7c89be3a0 100644 --- a/source/blender/nodes/shader/nodes/node_shader_emission.c +++ b/source/blender/nodes/shader/nodes/node_shader_emission.c @@ -51,7 +51,6 @@ void register_node_type_sh_emission(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_EMISSION, "Emission", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_emission_in, sh_node_emission_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_fresnel.c b/source/blender/nodes/shader/nodes/node_shader_fresnel.c index 072abed6c16..cb6b35ac4a7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_fresnel.c +++ b/source/blender/nodes/shader/nodes/node_shader_fresnel.c @@ -61,7 +61,6 @@ void register_node_type_sh_fresnel(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_FRESNEL, "Fresnel", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING | NODE_OLD_SHADING); node_type_socket_templates(&ntype, sh_node_fresnel_in, sh_node_fresnel_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_gamma.c b/source/blender/nodes/shader/nodes/node_shader_gamma.c index e536d198ed0..4a946e92778 100644 --- a/source/blender/nodes/shader/nodes/node_shader_gamma.c +++ b/source/blender/nodes/shader/nodes/node_shader_gamma.c @@ -62,7 +62,6 @@ void register_node_type_sh_gamma(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_GAMMA, "Gamma", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_gamma_in, sh_node_gamma_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_geometry.c b/source/blender/nodes/shader/nodes/node_shader_geometry.c index 2af3e3e259a..dfeebcea305 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geometry.c +++ b/source/blender/nodes/shader/nodes/node_shader_geometry.c @@ -55,7 +55,6 @@ void register_node_type_sh_geometry(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_NEW_GEOMETRY, "Geometry", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_geometry_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_hair_info.c b/source/blender/nodes/shader/nodes/node_shader_hair_info.c index 13259dce9d1..8b2f4b479ad 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hair_info.c +++ b/source/blender/nodes/shader/nodes/node_shader_hair_info.c @@ -48,7 +48,6 @@ void register_node_type_sh_hair_info(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_HAIR_INFO, "Hair Info", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, outputs); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_holdout.c b/source/blender/nodes/shader/nodes/node_shader_holdout.c index 42563f2bfa8..6109022fddf 100644 --- a/source/blender/nodes/shader/nodes/node_shader_holdout.c +++ b/source/blender/nodes/shader/nodes/node_shader_holdout.c @@ -45,7 +45,6 @@ void register_node_type_sh_holdout(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_HOLDOUT, "Holdout", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_holdout_in, sh_node_holdout_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c index 07f1e9e3233..c017765c8e2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c +++ b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c @@ -92,7 +92,6 @@ void register_node_type_sh_hue_sat(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_hue_sat_in, sh_node_hue_sat_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_exec(&ntype, NULL, NULL, node_shader_exec_hue_sat); diff --git a/source/blender/nodes/shader/nodes/node_shader_ies_light.c b/source/blender/nodes/shader/nodes/node_shader_ies_light.c index 8084f445e34..2714d560862 100644 --- a/source/blender/nodes/shader/nodes/node_shader_ies_light.c +++ b/source/blender/nodes/shader/nodes/node_shader_ies_light.c @@ -52,7 +52,6 @@ void register_node_type_sh_tex_ies(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_IES, "IES Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_ies_in, sh_node_tex_ies_out); node_type_init(&ntype, node_shader_init_tex_ies); node_type_storage(&ntype, "NodeShaderTexIES", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_invert.c b/source/blender/nodes/shader/nodes/node_shader_invert.c index b1805946f65..448d305b44e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_invert.c +++ b/source/blender/nodes/shader/nodes/node_shader_invert.c @@ -75,7 +75,6 @@ void register_node_type_sh_invert(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_invert_in, sh_node_invert_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_invert); node_type_gpu(&ntype, gpu_shader_invert); diff --git a/source/blender/nodes/shader/nodes/node_shader_layer_weight.c b/source/blender/nodes/shader/nodes/node_shader_layer_weight.c index 53bfad833eb..9c0b0a2f5f6 100644 --- a/source/blender/nodes/shader/nodes/node_shader_layer_weight.c +++ b/source/blender/nodes/shader/nodes/node_shader_layer_weight.c @@ -63,7 +63,6 @@ void register_node_type_sh_layer_weight(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_LAYER_WEIGHT, "Layer Weight", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING | NODE_OLD_SHADING); node_type_socket_templates(&ntype, sh_node_layer_weight_in, sh_node_layer_weight_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_light_falloff.c b/source/blender/nodes/shader/nodes/node_shader_light_falloff.c index 1dd7a945259..f32570eaeaa 100644 --- a/source/blender/nodes/shader/nodes/node_shader_light_falloff.c +++ b/source/blender/nodes/shader/nodes/node_shader_light_falloff.c @@ -55,7 +55,6 @@ void register_node_type_sh_light_falloff(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_LIGHT_FALLOFF, "Light Falloff", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_light_falloff_in, sh_node_light_falloff_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_light_path.c b/source/blender/nodes/shader/nodes/node_shader_light_path.c index 0e87da2215b..23d01ad4417 100644 --- a/source/blender/nodes/shader/nodes/node_shader_light_path.c +++ b/source/blender/nodes/shader/nodes/node_shader_light_path.c @@ -57,7 +57,6 @@ void register_node_type_sh_light_path(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_LIGHT_PATH, "Light Path", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_light_path_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_mapping.c b/source/blender/nodes/shader/nodes/node_shader_mapping.c index fdbf23618ef..a84e88e9551 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mapping.c +++ b/source/blender/nodes/shader/nodes/node_shader_mapping.c @@ -107,7 +107,6 @@ void register_node_type_sh_mapping(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_MAPPING, "Mapping", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_mapping_in, sh_node_mapping_out); node_type_size(&ntype, 320, 160, 360); node_type_init(&ntype, node_shader_init_mapping); diff --git a/source/blender/nodes/shader/nodes/node_shader_math.c b/source/blender/nodes/shader/nodes/node_shader_math.c index bf594325119..e3c52a9bc03 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.c +++ b/source/blender/nodes/shader/nodes/node_shader_math.c @@ -299,7 +299,6 @@ void register_node_type_sh_math(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_math_in, sh_node_math_out); node_type_label(&ntype, node_math_label); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c index 054b02b220d..b598859ab8e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c @@ -87,7 +87,6 @@ void register_node_type_sh_mix_rgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_mix_rgb_in, sh_node_mix_rgb_out); node_type_label(&ntype, node_blend_label); node_type_exec(&ntype, NULL, NULL, node_shader_exec_mix_rgb); diff --git a/source/blender/nodes/shader/nodes/node_shader_mix_shader.c b/source/blender/nodes/shader/nodes/node_shader_mix_shader.c index 892b41ab058..1d6c76766b3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mix_shader.c +++ b/source/blender/nodes/shader/nodes/node_shader_mix_shader.c @@ -52,7 +52,6 @@ void register_node_type_sh_mix_shader(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_MIX_SHADER, "Mix Shader", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_mix_shader_in, sh_node_mix_shader_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_normal.c b/source/blender/nodes/shader/nodes/node_shader_normal.c index 265f6ac6fab..121cb9cc1a5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal.c +++ b/source/blender/nodes/shader/nodes/node_shader_normal.c @@ -69,7 +69,6 @@ void register_node_type_sh_normal(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_normal_in, sh_node_normal_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_normal); node_type_gpu(&ntype, gpu_shader_normal); diff --git a/source/blender/nodes/shader/nodes/node_shader_normal_map.c b/source/blender/nodes/shader/nodes/node_shader_normal_map.c index 0d58be76030..3c0fb145987 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal_map.c +++ b/source/blender/nodes/shader/nodes/node_shader_normal_map.c @@ -111,7 +111,6 @@ void register_node_type_sh_normal_map(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_NORMAL_MAP, "Normal Map", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING | NODE_OLD_SHADING); node_type_socket_templates(&ntype, sh_node_normal_map_in, sh_node_normal_map_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_normal_map); diff --git a/source/blender/nodes/shader/nodes/node_shader_object_info.c b/source/blender/nodes/shader/nodes/node_shader_object_info.c index 623df319690..713e2f749f7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_object_info.c +++ b/source/blender/nodes/shader/nodes/node_shader_object_info.c @@ -52,7 +52,6 @@ void register_node_type_sh_object_info(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_OBJECT_INFO, "Object Info", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_object_info_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_output_lamp.c b/source/blender/nodes/shader/nodes/node_shader_output_lamp.c index b08a4b4ff57..f44f5d332cf 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_lamp.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_lamp.c @@ -39,8 +39,7 @@ void register_node_type_sh_output_lamp(void) { static bNodeType ntype; - sh_node_type_base(&ntype, SH_NODE_OUTPUT_LAMP, "Lamp Output", NODE_CLASS_OUTPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); + sh_node_type_base(&ntype, SH_NODE_OUTPUT_LIGHT, "Light Output", NODE_CLASS_OUTPUT, 0); node_type_socket_templates(&ntype, sh_node_output_lamp_in, NULL); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_output_linestyle.c b/source/blender/nodes/shader/nodes/node_shader_output_linestyle.c index 2eb68f23912..b56d6eca44b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_linestyle.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_linestyle.c @@ -43,7 +43,6 @@ void register_node_type_sh_output_linestyle(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_OUTPUT_LINESTYLE, "Line Style Output", NODE_CLASS_OUTPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_output_linestyle_in, NULL); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_output_material.c b/source/blender/nodes/shader/nodes/node_shader_output_material.c index 05837e79f82..81a89177351 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_material.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_material.c @@ -55,7 +55,6 @@ void register_node_type_sh_output_material(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_OUTPUT_MATERIAL, "Material Output", NODE_CLASS_OUTPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_output_material_in, NULL); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_output_world.c b/source/blender/nodes/shader/nodes/node_shader_output_world.c index 2c115bdda20..1980e6be5a3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_world.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_world.c @@ -51,7 +51,6 @@ void register_node_type_sh_output_world(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_OUTPUT_WORLD, "World Output", NODE_CLASS_OUTPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_output_world_in, NULL); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_particle_info.c b/source/blender/nodes/shader/nodes/node_shader_particle_info.c index 73c95fa2ba7..34c4d364fac 100644 --- a/source/blender/nodes/shader/nodes/node_shader_particle_info.c +++ b/source/blender/nodes/shader/nodes/node_shader_particle_info.c @@ -62,7 +62,6 @@ void register_node_type_sh_particle_info(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING | NODE_OLD_SHADING); node_type_socket_templates(&ntype, NULL, outputs); node_type_exec(&ntype, NULL, NULL, node_shader_exec_particle_info); node_type_gpu(&ntype, gpu_shader_particle_info); diff --git a/source/blender/nodes/shader/nodes/node_shader_rgb.c b/source/blender/nodes/shader/nodes/node_shader_rgb.c index dce7e5354e1..0ddad803270 100644 --- a/source/blender/nodes/shader/nodes/node_shader_rgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_rgb.c @@ -49,7 +49,6 @@ void register_node_type_sh_rgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_rgb_out); node_type_gpu(&ntype, gpu_shader_rgb); diff --git a/source/blender/nodes/shader/nodes/node_shader_script.c b/source/blender/nodes/shader/nodes/node_shader_script.c index 888e502a7f6..2d13fc214be 100644 --- a/source/blender/nodes/shader/nodes/node_shader_script.c +++ b/source/blender/nodes/shader/nodes/node_shader_script.c @@ -68,7 +68,6 @@ void register_node_type_sh_script(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SCRIPT, "Script", NODE_CLASS_SCRIPT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_init(&ntype, init); node_type_storage(&ntype, "NodeShaderScript", node_free_script, node_copy_script); diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c b/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c index 148f8e99c8f..09cd997f86b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c +++ b/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c @@ -63,7 +63,6 @@ void register_node_type_sh_sephsv(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SEPHSV, "Separate HSV", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_sephsv_in, sh_node_sephsv_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_sephsv); node_type_gpu(&ntype, gpu_shader_sephsv); @@ -104,7 +103,6 @@ void register_node_type_sh_combhsv(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_COMBHSV, "Combine HSV", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_combhsv_in, sh_node_combhsv_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_combhsv); node_type_gpu(&ntype, gpu_shader_combhsv); diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c index bd914399a28..b4810b95d4b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c +++ b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c @@ -64,7 +64,6 @@ void register_node_type_sh_seprgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SEPRGB, "Separate RGB", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_seprgb_in, sh_node_seprgb_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_seprgb); node_type_gpu(&ntype, gpu_shader_seprgb); @@ -108,7 +107,6 @@ void register_node_type_sh_combrgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_COMBRGB, "Combine RGB", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_combrgb_in, sh_node_combrgb_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_combrgb); node_type_gpu(&ntype, gpu_shader_combrgb); diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.c b/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.c index ba8bf565ca8..bff8e38b8c8 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.c +++ b/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.c @@ -54,7 +54,6 @@ void register_node_type_sh_sepxyz(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SEPXYZ, "Separate XYZ", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_sepxyz_in, sh_node_sepxyz_out); node_type_gpu(&ntype, gpu_shader_sepxyz); @@ -85,7 +84,6 @@ void register_node_type_sh_combxyz(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_COMBXYZ, "Combine XYZ", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_combxyz_in, sh_node_combxyz_out); node_type_gpu(&ntype, gpu_shader_combxyz); diff --git a/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c b/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c index c565c311efc..8617e3414b5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c @@ -51,7 +51,6 @@ void register_node_type_sh_shadertorgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SHADERTORGB, "Shader to RGB", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_shadertorgb_in, sh_node_shadertorgb_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_squeeze.c b/source/blender/nodes/shader/nodes/node_shader_squeeze.c index e46494efd34..51167db857b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_squeeze.c +++ b/source/blender/nodes/shader/nodes/node_shader_squeeze.c @@ -66,7 +66,6 @@ void register_node_type_sh_squeeze(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SQUEEZE, "Squeeze Value", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING); node_type_socket_templates(&ntype, sh_node_squeeze_in, sh_node_squeeze_out); node_type_storage(&ntype, "", NULL, NULL); node_type_exec(&ntype, NULL, NULL, node_shader_exec_squeeze); diff --git a/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c b/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c index 60442a46da1..57fb9026595 100644 --- a/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c +++ b/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c @@ -90,7 +90,6 @@ void register_node_type_sh_subsurface_scattering(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SUBSURFACE_SCATTERING, "Subsurface Scattering", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_subsurface_scattering_in, sh_node_subsurface_scattering_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_subsurface_scattering); diff --git a/source/blender/nodes/shader/nodes/node_shader_tangent.c b/source/blender/nodes/shader/nodes/node_shader_tangent.c index f2c59ec8fd8..da3a8e39ccb 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tangent.c +++ b/source/blender/nodes/shader/nodes/node_shader_tangent.c @@ -69,7 +69,6 @@ void register_node_type_sh_tangent(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TANGENT, "Tangent", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_tangent_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_tangent); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_brick.c b/source/blender/nodes/shader/nodes/node_shader_tex_brick.c index 67fe6d08ffd..227df5e8e56 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_brick.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_brick.c @@ -92,7 +92,6 @@ void register_node_type_sh_tex_brick(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_BRICK, "Brick Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_brick_in, sh_node_tex_brick_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_tex_brick); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_checker.c b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c index 633cc9a1d0e..4e065ffde23 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_checker.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c @@ -70,7 +70,6 @@ void register_node_type_sh_tex_checker(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_CHECKER, "Checker Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_checker_in, sh_node_tex_checker_out); node_type_init(&ntype, node_shader_init_tex_checker); node_type_storage(&ntype, "NodeTexChecker", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c index 360b28d768a..002fdc6d3ae 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c @@ -70,7 +70,6 @@ void register_node_type_sh_tex_coord(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_COORD, "Texture Coordinate", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_tex_coord_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c index 02b784ca540..3e52a6c3d7d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c @@ -97,7 +97,6 @@ void register_node_type_sh_tex_environment(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_ENVIRONMENT, "Environment Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_environment_in, sh_node_tex_environment_out); node_type_init(&ntype, node_shader_init_tex_environment); node_type_storage(&ntype, "NodeTexEnvironment", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c index 0721a24688f..06f3773e6d8 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c @@ -70,7 +70,6 @@ void register_node_type_sh_tex_gradient(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_GRADIENT, "Gradient Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_gradient_in, sh_node_tex_gradient_out); node_type_init(&ntype, node_shader_init_tex_gradient); node_type_storage(&ntype, "NodeTexGradient", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.c b/source/blender/nodes/shader/nodes/node_shader_tex_image.c index e27cf02f445..55669b57998 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c @@ -121,7 +121,6 @@ void register_node_type_sh_tex_image(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_IMAGE, "Image Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_image_in, sh_node_tex_image_out); node_type_init(&ntype, node_shader_init_tex_image); node_type_storage(&ntype, "NodeTexImage", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_magic.c b/source/blender/nodes/shader/nodes/node_shader_tex_magic.c index 14e6cbf337e..deb81b7b78f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_magic.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_magic.c @@ -73,7 +73,6 @@ void register_node_type_sh_tex_magic(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_MAGIC, "Magic Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_magic_in, sh_node_tex_magic_out); node_type_init(&ntype, node_shader_init_tex_magic); node_type_storage(&ntype, "NodeTexMagic", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c index 48ab45895bc..03f401e7f01 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c @@ -77,7 +77,6 @@ void register_node_type_sh_tex_musgrave(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_MUSGRAVE, "Musgrave Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_musgrave_in, sh_node_tex_musgrave_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_tex_musgrave); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c index 2f6994c6533..e2879528a5f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c @@ -70,7 +70,6 @@ void register_node_type_sh_tex_noise(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_NOISE, "Noise Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_noise_in, sh_node_tex_noise_out); node_type_init(&ntype, node_shader_init_tex_noise); node_type_storage(&ntype, "NodeTexNoise", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c b/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c index 436eeeefb4a..1c5f53132bd 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c @@ -85,7 +85,6 @@ void register_node_type_sh_tex_pointdensity(void) "Point Density", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_pointdensity_in, sh_node_tex_pointdensity_out); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c index 8a17ee1e0d2..821d4b41d09 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c @@ -70,7 +70,6 @@ void register_node_type_sh_tex_sky(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_SKY, "Sky Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_sky_in, sh_node_tex_sky_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_tex_sky); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c index 7f30d244da6..36b6174059a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c @@ -72,7 +72,6 @@ void register_node_type_sh_tex_voronoi(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_VORONOI, "Voronoi Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_voronoi_in, sh_node_tex_voronoi_out); node_type_init(&ntype, node_shader_init_tex_voronoi); node_type_storage(&ntype, "NodeTexVoronoi", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c index a9071fdbdd4..2b06f66eb63 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c @@ -76,7 +76,6 @@ void register_node_type_sh_tex_wave(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_WAVE, "Wave Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_wave_in, sh_node_tex_wave_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_tex_wave); diff --git a/source/blender/nodes/shader/nodes/node_shader_uvAlongStroke.c b/source/blender/nodes/shader/nodes/node_shader_uvAlongStroke.c index 67342e1e836..023f5417e22 100644 --- a/source/blender/nodes/shader/nodes/node_shader_uvAlongStroke.c +++ b/source/blender/nodes/shader/nodes/node_shader_uvAlongStroke.c @@ -40,7 +40,6 @@ void register_node_type_sh_uvalongstroke(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_UVALONGSTROKE, "UV Along Stroke", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_uvalongstroke_out); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_uvmap.c b/source/blender/nodes/shader/nodes/node_shader_uvmap.c index c47bb9022b6..9da1056b47f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_uvmap.c +++ b/source/blender/nodes/shader/nodes/node_shader_uvmap.c @@ -56,7 +56,6 @@ void register_node_type_sh_uvmap(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_UVMAP, "UV Map", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_uvmap_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_uvmap); diff --git a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c index a1879df3a18..b6581cb18cb 100644 --- a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c @@ -77,7 +77,6 @@ void register_node_type_sh_valtorgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_valtorgb_in, sh_node_valtorgb_out); node_type_init(&ntype, node_shader_init_valtorgb); node_type_size_preset(&ntype, NODE_SIZE_LARGE); @@ -120,7 +119,6 @@ void register_node_type_sh_rgbtobw(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_rgbtobw_in, sh_node_rgbtobw_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_rgbtobw); node_type_gpu(&ntype, gpu_shader_rgbtobw); diff --git a/source/blender/nodes/shader/nodes/node_shader_value.c b/source/blender/nodes/shader/nodes/node_shader_value.c index a1b8717cebc..a143b0118e7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_value.c +++ b/source/blender/nodes/shader/nodes/node_shader_value.c @@ -49,7 +49,6 @@ void register_node_type_sh_value(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VALUE, "Value", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_value_out); node_type_gpu(&ntype, gpu_shader_value); diff --git a/source/blender/nodes/shader/nodes/node_shader_vectMath.c b/source/blender/nodes/shader/nodes/node_shader_vectMath.c index ca5291e6041..8087e1cab41 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vectMath.c +++ b/source/blender/nodes/shader/nodes/node_shader_vectMath.c @@ -141,7 +141,6 @@ void register_node_type_sh_vect_math(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VECT_MATH, "Vector Math", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_vect_math_in, sh_node_vect_math_out); node_type_label(&ntype, node_vect_math_label); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_vectTransform.c b/source/blender/nodes/shader/nodes/node_shader_vectTransform.c index d0b16dd5886..63964e27d20 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vectTransform.c +++ b/source/blender/nodes/shader/nodes/node_shader_vectTransform.c @@ -136,7 +136,6 @@ void register_node_type_sh_vect_transform(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VECT_TRANSFORM, "Vector Transform", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_init(&ntype, node_shader_init_vect_transform); node_type_socket_templates(&ntype, sh_node_vect_transform_in, sh_node_vect_transform_out); node_type_storage(&ntype, "NodeShaderVectTransform", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c b/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c index 79b41509fcc..2a40d98baf9 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c +++ b/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c @@ -73,7 +73,6 @@ void register_node_type_sh_vector_displacement(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VECTOR_DISPLACEMENT, "Vector Displacement", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_vector_displacement_in, sh_node_vector_displacement_out); node_type_storage(&ntype, "", NULL, NULL); node_type_init(&ntype, node_shader_init_vector_displacement); diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_absorption.c b/source/blender/nodes/shader/nodes/node_shader_volume_absorption.c index 518ab6587b2..d0ba43d1a15 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_absorption.c +++ b/source/blender/nodes/shader/nodes/node_shader_volume_absorption.c @@ -51,7 +51,6 @@ void register_node_type_sh_volume_absorption(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VOLUME_ABSORPTION, "Volume Absorption", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_volume_absorption_in, sh_node_volume_absorption_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_principled.c b/source/blender/nodes/shader/nodes/node_shader_volume_principled.c index 40d24df6845..a88a7ebb21a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_principled.c +++ b/source/blender/nodes/shader/nodes/node_shader_volume_principled.c @@ -153,7 +153,6 @@ void register_node_type_sh_volume_principled(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VOLUME_PRINCIPLED, "Principled Volume", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_volume_principled_in, sh_node_volume_principled_out); node_type_size_preset(&ntype, NODE_SIZE_LARGE); node_type_init(&ntype, node_shader_init_volume_principled); diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_scatter.c b/source/blender/nodes/shader/nodes/node_shader_volume_scatter.c index 34ba179b4a3..0f97d08803a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_scatter.c +++ b/source/blender/nodes/shader/nodes/node_shader_volume_scatter.c @@ -52,7 +52,6 @@ void register_node_type_sh_volume_scatter(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VOLUME_SCATTER, "Volume Scatter", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_volume_scatter_in, sh_node_volume_scatter_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_wavelength.c b/source/blender/nodes/shader/nodes/node_shader_wavelength.c index f903e314edf..edc4333c000 100644 --- a/source/blender/nodes/shader/nodes/node_shader_wavelength.c +++ b/source/blender/nodes/shader/nodes/node_shader_wavelength.c @@ -44,7 +44,6 @@ void register_node_type_sh_wavelength(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_WAVELENGTH, "Wavelength", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_socket_templates(&ntype, sh_node_wavelength_in, sh_node_wavelength_out); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_wireframe.c b/source/blender/nodes/shader/nodes/node_shader_wireframe.c index 0b9f3ac347a..11d889def31 100644 --- a/source/blender/nodes/shader/nodes/node_shader_wireframe.c +++ b/source/blender/nodes/shader/nodes/node_shader_wireframe.c @@ -44,7 +44,6 @@ void register_node_type_sh_wireframe(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_WIREFRAME, "Wireframe", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_wireframe_in, sh_node_wireframe_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/python/gawain/gwn_py_types.c b/source/blender/python/gawain/gwn_py_types.c index 9ddad009a12..bdf0be9f7e1 100644 --- a/source/blender/python/gawain/gwn_py_types.c +++ b/source/blender/python/gawain/gwn_py_types.c @@ -210,7 +210,7 @@ static void fill_format_elem(void *data_dst_void, PyObject *py_src, const Gwn_Ve /* No error checking, callers must run PyErr_Occurred */ static void fill_format_tuple(void *data_dst_void, PyObject *py_src, const Gwn_VertAttr *attr) { - const uint len = attr->comp_ct; + const uint len = attr->comp_len; /** * Args are constants, so range checks will be optimized out if they're nop's. @@ -247,15 +247,15 @@ static bool bpygwn_vertbuf_fill_impl( const uint seq_len = PySequence_Fast_GET_SIZE(seq_fast); - if (seq_len != vbo->vertex_ct) { + if (seq_len != vbo->vertex_len) { PyErr_Format(PyExc_ValueError, "Expected a sequence of size %d, got %d", - vbo->vertex_ct, seq_len); + vbo->vertex_len, seq_len); } PyObject **seq_items = PySequence_Fast_ITEMS(seq_fast); - if (attr->comp_ct == 1) { + if (attr->comp_len == 1) { for (uint i = 0; i < seq_len; i++) { uchar *data = (uchar *)GWN_vertbuf_raw_step(&data_step); PyObject *item = seq_items[i]; @@ -273,10 +273,10 @@ static bool bpygwn_vertbuf_fill_impl( ok = false; goto finally; } - if (PyTuple_GET_SIZE(item) != attr->comp_ct) { + if (PyTuple_GET_SIZE(item) != attr->comp_len) { PyErr_Format(PyExc_ValueError, "expected a tuple of size %d, got %d", - attr->comp_ct, PyTuple_GET_SIZE(item)); + attr->comp_len, PyTuple_GET_SIZE(item)); ok = false; goto finally; } @@ -300,8 +300,8 @@ finally: #if 0 static int bpygwn_find_id(const Gwn_VertFormat *fmt, const char *id) { - for (int i = 0; i < fmt->attrib_ct; i++) { - for (uint j = 0; j < fmt->name_ct; j++) { + for (int i = 0; i < fmt->attr_len; i++) { + for (uint j = 0; j < fmt->name_len; j++) { if (STREQ(fmt->attribs[i].name[j], id)) { return i; } @@ -346,7 +346,7 @@ static PyObject *bpygwn_VertFormat_attr_add(BPyGwn_VertFormat *self, PyObject *a Gwn_VertFetchMode fetch_mode; } params; - if (self->fmt.attrib_ct == GWN_VERT_ATTR_MAX_LEN) { + if (self->fmt.attr_len == GWN_VERT_ATTR_MAX_LEN) { PyErr_SetString(PyExc_ValueError, "Maxumum attr reached " STRINGIFY(GWN_VERT_ATTR_MAX_LEN)); return NULL; } @@ -440,7 +440,7 @@ static PyObject *bpygwn_VertBuf_fill(BPyGwn_VertBuf *self, PyObject *args, PyObj return NULL; } - if (params.id >= self->buf->format.attrib_ct) { + if (params.id >= self->buf->format.attr_len) { PyErr_Format(PyExc_ValueError, "Format id %d out of range", params.id); @@ -532,10 +532,10 @@ static PyObject *bpygwn_VertBatch_vertbuf_add(BPyGwn_Batch *self, BPyGwn_VertBuf return NULL; } - if (self->batch->verts[0]->vertex_ct != py_buf->buf->vertex_ct) { + if (self->batch->verts[0]->vertex_len != py_buf->buf->vertex_len) { PyErr_Format(PyExc_TypeError, "Expected %d length, got %d", - self->batch->verts[0]->vertex_ct, py_buf->buf->vertex_ct); + self->batch->verts[0]->vertex_len, py_buf->buf->vertex_len); return NULL; } diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index b8c71d4e054..d3464ea5841 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -255,7 +255,6 @@ static void pydriver_error(ChannelDriver *driver) #define OK_OP(op) [op] = 1 const char secure_opcodes[255] = { - OK_OP(0), OK_OP(POP_TOP), OK_OP(ROT_TWO), OK_OP(ROT_THREE), @@ -349,15 +348,14 @@ static bool bpy_driver_secure_bytecode_validate(PyObject *expr_code, PyObject *d /* Check opcodes. */ { - const char *codestr; + const _Py_CODEUNIT *codestr; Py_ssize_t code_len; PyBytes_AsStringAndSize(py_code->co_code, (char **)&codestr, &code_len); + code_len /= sizeof(*codestr); -#define CODESIZE(op) (HAS_ARG(op) ? 3 : 1) - - for (Py_ssize_t i = 0; i < code_len; i += CODESIZE(codestr[i])) { - const int opcode = codestr[i]; + for (Py_ssize_t i = 0; i < code_len; i++) { + const int opcode = _Py_OPCODE(codestr[i]); if (secure_opcodes[opcode] == 0) { fprintf(stderr, "\tBPY_driver_eval() - restructed access disallows opcode '%d', " "enable auto-execution to support\n", opcode); diff --git a/source/blender/python/simple_enum_gen.py b/source/blender/python/simple_enum_gen.py index 6094154050b..3a9c1847fc7 100644 --- a/source/blender/python/simple_enum_gen.py +++ b/source/blender/python/simple_enum_gen.py @@ -1,22 +1,22 @@ - # ***** BEGIN GPL LICENSE BLOCK ***** - # - # This program is free software; you can redistribute it and/or - # modify it under the terms of the GNU General Public License - # as published by the Free Software Foundation; either version 2 - # of the License, or (at your option) any later version. - # - # This program is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License - # along with this program; if not, write to the Free Software Foundation, - # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - # - # Contributor(s): Campbell Barton - # - # #**** END GPL LICENSE BLOCK #**** +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ***** END GPL LICENSE BLOCK ***** + +# <pep8 compliant> defs = """ SPACE_EMPTY, diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 0a61747e590..ccbed11e6e8 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -609,7 +609,8 @@ bool WM_event_is_ime_switch(const struct wmEvent *event); const char *WM_window_cursor_keymap_status_get(const struct wmWindow *win, int button_index, int type_index); void WM_window_cursor_keymap_status_refresh(struct bContext *C, struct wmWindow *win); -struct ScrArea *WM_window_find_area_status(struct wmWindow *win, struct bScreen *sc); +void WM_window_status_area_tag_redraw(struct wmWindow *win); +struct ScrArea *WM_window_status_area_find(struct wmWindow *win, struct bScreen *sc); bool WM_window_modal_keymap_status_draw( struct bContext *C, struct wmWindow *win, struct uiLayout *layout); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 19889f57261..8469dc9da0e 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1973,11 +1973,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand if (op->type->modalkeymap) { wmWindow *win = CTX_wm_window(C); - bScreen *sc = WM_window_get_active_screen(win); - ScrArea *sa = WM_window_find_area_status(win, sc); - if (sa != NULL) { - ED_area_tag_redraw(sa); - } + WM_window_status_area_tag_redraw(win); } } else { @@ -3211,11 +3207,7 @@ wmEventHandler *WM_event_add_modal_handler(bContext *C, wmOperator *op) BLI_addhead(&win->modalhandlers, handler); if (op->type->modalkeymap) { - bScreen *sc = WM_window_get_active_screen(win); - ScrArea *sa = WM_window_find_area_status(win, sc); - if (sa != NULL) { - ED_area_tag_redraw(sa); - } + WM_window_status_area_tag_redraw(win); } return handler; @@ -4352,7 +4344,7 @@ const char *WM_window_cursor_keymap_status_get(const wmWindow *win, int button_i * Similar to #BKE_screen_area_map_find_area_xy and related functions, * use here since the ara is stored in the window manager. */ -ScrArea *WM_window_find_area_status(wmWindow *win, bScreen *screen) +ScrArea *WM_window_status_area_find(wmWindow *win, bScreen *screen) { if (screen->state == SCREENFULL) { return NULL; @@ -4367,10 +4359,19 @@ ScrArea *WM_window_find_area_status(wmWindow *win, bScreen *screen) return sa_statusbar; } +void WM_window_status_area_tag_redraw(wmWindow *win) +{ + bScreen *sc = WM_window_get_active_screen(win); + ScrArea *sa = WM_window_status_area_find(win, sc); + if (sa != NULL) { + ED_area_tag_redraw(sa); + } +} + void WM_window_cursor_keymap_status_refresh(bContext *C, wmWindow *win) { bScreen *screen = WM_window_get_active_screen(win); - ScrArea *sa_statusbar = WM_window_find_area_status(win, screen); + ScrArea *sa_statusbar = WM_window_status_area_find(win, screen); if (sa_statusbar == NULL) { return; } @@ -4524,14 +4525,14 @@ bool WM_window_modal_keymap_status_draw( uiLayout *layout) { wmKeyMap *keymap = NULL; - wmOperatorType *ot = NULL; + wmOperator *op = NULL; for (wmEventHandler *handler = win->modalhandlers.first; handler; handler = handler->next) { if (handler->op) { /* 'handler->keymap' could be checked too, seems not to be used. */ wmKeyMap *keymap_test = handler->op->type->modalkeymap; if (keymap_test && keymap_test->modal_items) { keymap = keymap_test; - ot = handler->op->type; + op = handler->op; break; } } @@ -4546,14 +4547,49 @@ bool WM_window_modal_keymap_status_draw( if (!items[i].identifier[0]) { continue; } - char buf[UI_MAX_DRAW_STR]; - int available_len = sizeof(buf); - char *p = buf; - WM_modalkeymap_operator_items_to_string_buf(ot, items[i].value, true, UI_MAX_SHORTCUT_STR, &available_len, &p); - p -= 1; - if (p > buf) { - BLI_snprintf(p, available_len, ": %s", items[i].name); - uiItemL(row, buf, 0); + if ((keymap->poll_modal_item != NULL) && + (keymap->poll_modal_item(op, items[i].value) == false)) + { + continue; + } + + bool show_text = true; + + { + /* warning: O(n^2) */ + wmKeyMapItem *kmi = NULL; + for (kmi = keymap->items.first; kmi; kmi = kmi->next) { + if (kmi->propvalue == items[i].value) { + break; + } + } + if (kmi != NULL) { + if (kmi->val == KM_RELEASE) { + /* Assume release events just disable something which was toggled on. */ + continue; + } + int icon_mod[4]; + int icon = UI_icon_from_keymap_item(kmi, icon_mod); + if (icon != 0) { + for (int j = 0; j < ARRAY_SIZE(icon_mod) && icon_mod[j]; j++) { + uiItemL(row, "", icon_mod[j]); + } + uiItemL(row, items[i].name, icon); + show_text = false; + } + } + } + if (show_text) { + char buf[UI_MAX_DRAW_STR]; + int available_len = sizeof(buf); + char *p = buf; + WM_modalkeymap_operator_items_to_string_buf( + op->type, items[i].value, true, UI_MAX_SHORTCUT_STR, &available_len, &p); + p -= 1; + if (p > buf) { + BLI_snprintf(p, available_len, ": %s", items[i].name); + uiItemL(row, buf, 0); + } } } return true; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 1983c0e6b84..926169e77fd 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2569,11 +2569,11 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); if (rc->gltex) { - unsigned int texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, rc->gltex); @@ -2701,7 +2701,7 @@ static void radial_control_paint_cursor(bContext *UNUSED(C), int x, int y, void RNA_property_float_get_array(&rc->col_ptr, rc->col_prop, col); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3fvAlpha(col, 0.5f); @@ -3558,7 +3558,7 @@ static const EnumPropertyItem preview_id_type_items[] = { {FILTER_ID_GR, "GROUP", 0, "Groups", ""}, {FILTER_ID_OB, "OBJECT", 0, "Objects", ""}, {FILTER_ID_MA, "MATERIAL", 0, "Materials", ""}, - {FILTER_ID_LA, "LAMP", 0, "Lamps", ""}, + {FILTER_ID_LA, "LIGHT", 0, "Lights", ""}, {FILTER_ID_WO, "WORLD", 0, "Worlds", ""}, {FILTER_ID_TE, "TEXTURE", 0, "Textures", ""}, {FILTER_ID_IM, "IMAGE", 0, "Images", ""}, @@ -3996,6 +3996,11 @@ void wm_window_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "WM_OT_quit_blender", QKEY, KM_PRESS, KM_CTRL, 0); + /* F-Keys are a hassle on some macos systems. */ +#ifdef __APPLE__ + WM_keymap_add_item(keymap, "WM_OT_search_menu", FKEY, KM_PRESS, KM_OSKEY, 0); +#endif + #ifdef USE_WM_KEYMAP_27X WM_keymap_add_item(keymap, "WM_OT_doc_view_manual_ui_context", F1KEY, KM_PRESS, KM_ALT, 0); @@ -4010,8 +4015,6 @@ void wm_window_keymap(wmKeyConfig *keyconf) #endif /* menus that can be accessed anywhere in blender */ - WM_keymap_add_item(keymap, "WM_OT_search_menu", ACCENTGRAVEKEY, KM_CLICK, 0, 0); - WM_keymap_add_menu(keymap, "SCREEN_MT_user_menu", QKEY, KM_PRESS, 0, 0); #ifdef WITH_INPUT_NDOF diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 8c062be2a00..ef7992dcb8c 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -139,6 +139,9 @@ typedef struct PlayState { /* restarts player for file drop */ char dropped_file[FILE_MAX]; + + bool need_frame_update; + int frame_cursor_x; } PlayState; /* for debugging */ @@ -368,7 +371,7 @@ static void playanim_toscreen(PlayState *ps, PlayAnimPict *picture, struct ImBuf gpuPushMatrix(); gpuLoadIdentity(); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ub(0, 255, 0); @@ -558,8 +561,18 @@ static void update_sound_fps(void) #endif } -static void change_frame(PlayState *ps, int cx) +static void tag_change_frame(PlayState *ps, int cx) +{ + ps->need_frame_update = true; + ps->frame_cursor_x = cx; +} + +static void change_frame(PlayState *ps) { + if (!ps->need_frame_update) { + return; + } + int sizex, sizey; int i, i_last; @@ -569,7 +582,7 @@ static void change_frame(PlayState *ps, int cx) playanim_window_get_size(&sizex, &sizey); i_last = ((struct PlayAnimPict *)picsbase.last)->frame; - i = (i_last * cx) / sizex; + i = (i_last * ps->frame_cursor_x) / sizex; CLAMP(i, 0, i_last); #ifdef WITH_AUDASPACE @@ -610,6 +623,8 @@ static void change_frame(PlayState *ps, int cx) ps->sstep = true; ps->wait2 = false; ps->next_frame = 0; + + ps->need_frame_update = false; } static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) @@ -961,7 +976,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) if (type == GHOST_kEventButtonDown) { if (inside_window) { g_WS.qual |= WS_QUAL_LMOUSE; - change_frame(ps, cx); + tag_change_frame(ps, cx); } } else @@ -1006,7 +1021,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) GHOST_ScreenToClient(g_WS.ghost_window, cd->x, cd->y, &cx, &cy); - change_frame(ps, cx); + tag_change_frame(ps, cx); } break; } @@ -1442,23 +1457,18 @@ static char *wm_main_playanim_intern(int argc, const char **argv) ps.next_frame = ps.direction; - while ((hasevent = GHOST_ProcessEvents(g_WS.ghost_system, ps.wait2))) { - if (hasevent) { - GHOST_DispatchEvents(g_WS.ghost_system); - } - /* Note, this still draws for mousemoves on pause */ - if (ps.wait2) { - if (hasevent) { - if (ibuf) { - while (pupdate_time()) PIL_sleep_ms(1); - ptottime -= swaptime; - playanim_toscreen(&ps, ps.picture, ibuf, ps.fontid, ps.fstep); - } - } - } - if (ps.go == false) { - break; - } + while ((hasevent = GHOST_ProcessEvents(g_WS.ghost_system, 0))) { + GHOST_DispatchEvents(g_WS.ghost_system); + } + if (ps.go == false) { + break; + } + change_frame(&ps); + if (!hasevent) { + PIL_sleep_ms(1); + } + if (ps.wait2) { + continue; } ps.wait2 = ps.sstep; diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c index 2c779ba9c7c..1e9f6d6231b 100644 --- a/source/blender/windowmanager/intern/wm_stereo.c +++ b/source/blender/windowmanager/intern/wm_stereo.c @@ -88,8 +88,8 @@ void wm_stereo3d_draw_interlace(wmWindow *win, ARegion *ar) float halfy = GLA_PIXEL_OFS / ar->winy; Gwn_VertFormat *format = immVertexFormat(); - unsigned int texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); /* leave GL_TEXTURE0 as the latest active texture */ for (int view = 1; view >= 0; view--) { @@ -164,8 +164,8 @@ void wm_stereo3d_draw_sidebyside(wmWindow *win, int view) bool cross_eyed = (win->stereo3d_format->flag & S3D_SIDEBYSIDE_CROSSEYED) != 0; Gwn_VertFormat *format = immVertexFormat(); - unsigned int texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE); @@ -210,8 +210,8 @@ void wm_stereo3d_draw_sidebyside(wmWindow *win, int view) void wm_stereo3d_draw_topbottom(wmWindow *win, int view) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE); |