diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2016-12-01 12:29:46 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2016-12-01 12:29:46 +0300 |
commit | ff2a74906a7b70625a4e941c6a805f7734491204 (patch) | |
tree | 562f5ccdd9f4e377d20fe22eadca48201924b4b3 /source/blender/makesrna | |
parent | 73c1c92c0e86ce1b5a8abeaa16be2bf2c259412b (diff) | |
parent | 58877d6d082d82185ca611b704364168e5984bd7 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 10 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 10 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_main.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 22 |
6 files changed, 47 insertions, 15 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index b2b97ce85d9..5f54852328c 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1536,7 +1536,11 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) const char *nextfunc = (const char *)cprop->next; const char *item_type = (const char *)cprop->item_type; - if (dp->dnatype && STREQ(dp->dnatype, "ListBase")) { + if (cprop->length) { + /* always generate if we have a manual implementation */ + cprop->length = (void *)rna_def_property_length_func(f, srna, prop, dp, (const char *)cprop->length); + } + else if (dp->dnatype && STREQ(dp->dnatype, "ListBase")) { /* pass */ } else if (dp->dnalengthname || dp->dnalengthfixed) { diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index ee662bc2b0d..aef88af118a 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -346,7 +346,9 @@ static struct ID *rna_ID_make_local(struct ID *self, Main *bmain, int clear_prox id_make_local(bmain, self, false, false); } - return self->newid ? self->newid : self; + ID *ret_id = self->newid ? self->newid : self; + BKE_id_clear_newpoin(self); + return ret_id; } @@ -1006,9 +1008,9 @@ static void rna_def_ID(BlenderRNA *brna) RNA_def_function_ui_description(func, "Make this datablock local, return local one " "(may be a copy of the original, in case it is also indirectly used)"); RNA_def_function_flag(func, FUNC_USE_MAIN); - RNA_def_boolean(func, "clear_proxy", true, "", - "Whether to clear proxies (the default behavior); can cause proxies to be duplicated" - " when still referred to from another library"); + parm = RNA_def_boolean(func, "clear_proxy", true, "", + "Whether to clear proxies (the default behavior, " + "note that if object has to be duplicated to be made local, proxies are always cleared)"); RNA_def_property_flag(parm, PROP_PYFUNC_OPTIONAL); parm = RNA_def_pointer(func, "id", "ID", "", "This ID, or the new ID if it was copied"); RNA_def_function_return(func, parm); diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 7ba89538b18..16aa60e1b91 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -585,11 +585,11 @@ static bGPDframe *rna_GPencil_frame_copy(bGPDlayer *layer, bGPDframe *src) static bGPDlayer *rna_GPencil_layer_new(bGPdata *gpd, const char *name, int setactive) { - bGPDlayer *gl = BKE_gpencil_layer_addnew(gpd, name, setactive != 0); + bGPDlayer *gpl = BKE_gpencil_layer_addnew(gpd, name, setactive != 0); WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); - return gl; + return gpl; } static void rna_GPencil_layer_remove(bGPdata *gpd, ReportList *reports, PointerRNA *layer_ptr) @@ -1354,7 +1354,7 @@ static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Add a new grease pencil layer"); parm = RNA_def_string(func, "name", "GPencilLayer", MAX_NAME, "Name", "Name of the layer"); RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_boolean(func, "set_active", 0, "Set Active", "Set the newly created layer to the active layer"); + RNA_def_boolean(func, "set_active", true, "Set Active", "Set the newly created layer to the active layer"); parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The newly created layer"); RNA_def_function_return(func, parm); @@ -1443,7 +1443,7 @@ static void rna_def_gpencil_palettecolor(BlenderRNA *brna) prop = RNA_def_property(srna, "ghost", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PC_COLOR_ONIONSKIN); RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0); - RNA_def_property_ui_text(prop, "Ghost", "Display the color in onion skinning"); + RNA_def_property_ui_text(prop, "Show in Ghosts", "Display strokes using this color when showing onion skins"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); /* Draw Style */ @@ -1557,7 +1557,7 @@ static void rna_def_gpencil_palettes_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Add a new grease pencil palette"); parm = RNA_def_string(func, "name", "GPencilPalette", MAX_NAME, "Name", "Name of the palette"); RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_boolean(func, "set_active", 0, "Set Active", "Activate the newly created palette"); + RNA_def_boolean(func, "set_active", true, "Set Active", "Activate the newly created palette"); parm = RNA_def_pointer(func, "palette", "GPencilPalette", "", "The newly created palette"); RNA_def_function_return(func, parm); diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 59f079b4259..d5d6f609a03 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -392,7 +392,7 @@ void RNA_def_main(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Use Autopack", "Automatically pack all external data into .blend file"); prop = RNA_def_int_vector(srna, "version", 3, NULL, 0, INT_MAX, - "Version", "Version of the blender the .blend was saved with", 0, INT_MAX); + "Version", "Version of Blender the .blend was saved with", 0, INT_MAX); RNA_def_property_int_funcs(prop, "rna_Main_version_get", NULL, NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_THICK_WRAP); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index e68f75a1399..772c1d9e4ed 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -3076,6 +3076,9 @@ void rna_ShaderNodePointDensity_density_cache(bNode *self, sizeof(pd->vertex_attribute_name)); } + /* Store resolution, so it can be changed in the UI. */ + shader_point_density->cached_resolution = shader_point_density->resolution; + /* Single-threaded sampling of the voxel domain. */ RE_point_density_cache(scene, pd, @@ -3090,15 +3093,15 @@ void rna_ShaderNodePointDensity_density_calc(bNode *self, { NodeShaderTexPointDensity *shader_point_density = self->storage; PointDensity *pd = &shader_point_density->pd; + const int resolution = shader_point_density->cached_resolution; if (scene == NULL) { *length = 0; return; } - *length = 4 * shader_point_density->resolution * - shader_point_density->resolution * - shader_point_density->resolution; + /* TODO(sergey): Will likely overflow, but how to pass size_t via RNA? */ + *length = 4 * resolution * resolution * resolution; if (*values == NULL) { *values = MEM_mallocN(sizeof(float) * (*length), "point density dynamic array"); @@ -3106,13 +3109,14 @@ void rna_ShaderNodePointDensity_density_calc(bNode *self, /* Single-threaded sampling of the voxel domain. */ RE_point_density_sample(scene, pd, - shader_point_density->resolution, + resolution, settings == 1, *values); /* We're done, time to clean up. */ BKE_texture_pointdensity_free_data(pd); memset(pd, 0, sizeof(*pd)); + shader_point_density->cached_resolution = 0.0f; } void rna_ShaderNodePointDensity_density_minmax(bNode *self, diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index b3aea604926..6140fcc18cd 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -124,6 +124,14 @@ static EnumPropertyItem rna_enum_language_default_items[] = { #endif +static void rna_userdef_version_get(PointerRNA *ptr, int *value) +{ + UserDef *userdef = (UserDef *)ptr->data; + value[0] = userdef->versionfile / 100; + value[1] = userdef->versionfile % 100; + value[2] = userdef->subversionfile; +} + static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) { WM_main_add_notifier(NC_WINDOW, NULL); @@ -4190,6 +4198,14 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_ui_text(prop, "OpenSubdiv Compute Type", "Type of computer back-end used with OpenSubdiv"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_userdef_opensubdiv_update"); #endif + +#ifdef WITH_CYCLES + prop = RNA_def_property(srna, "legacy_compute_device_type", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "compute_device_type"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_flag(prop, PROP_HIDDEN); + RNA_def_property_ui_text(prop, "Legacy Compute Device Type", "For backwards compatibility only"); +#endif } static void rna_def_userdef_input(BlenderRNA *brna) @@ -4707,6 +4723,12 @@ void RNA_def_userdef(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings"); + prop = RNA_def_int_vector(srna, "version", 3, NULL, 0, INT_MAX, + "Version", "Version of Blender the userpref.blend was saved with", 0, INT_MAX); + RNA_def_property_int_funcs(prop, "rna_userdef_version_get", NULL, NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_flag(prop, PROP_THICK_WRAP); + rna_def_userdef_view(brna); rna_def_userdef_edit(brna); rna_def_userdef_input(brna); |