diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index fc17b9a24a5..88641bdb663 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -110,6 +110,12 @@ INFO_DOCS = ( ("info_gotcha.rst", "Gotcha's: some of the problems you may come up against when writing scripts"), ) +# only support for properties atm. +RNA_BLACKLIST = { + # messes up PDF!, really a bug but for now just workaround. + "UserPreferencesSystem": {"language", }, + } + # ----------------------------------------------------------------------------- # configure compile time options @@ -757,22 +763,23 @@ def pyrna2sphinx(BASEPATH): fw = file.write base_id = getattr(struct.base, "identifier", "") + struct_id = struct.identifier if _BPY_STRUCT_FAKE: if not base_id: base_id = _BPY_STRUCT_FAKE if base_id: - title = "%s(%s)" % (struct.identifier, base_id) + title = "%s(%s)" % (struct_id, base_id) else: - title = struct.identifier + title = struct_id write_title(fw, title, "=") fw(".. module:: bpy.types\n\n") # docs first?, ok - write_example_ref("", fw, "bpy.types.%s" % struct.identifier) + write_example_ref("", fw, "bpy.types.%s" % struct_id) base_ids = [base.identifier for base in struct.get_bases()] @@ -801,9 +808,9 @@ def pyrna2sphinx(BASEPATH): base_id = _BPY_STRUCT_FAKE if base_id: - fw(".. class:: %s(%s)\n\n" % (struct.identifier, base_id)) + fw(".. class:: %s(%s)\n\n" % (struct_id, base_id)) else: - fw(".. class:: %s\n\n" % struct.identifier) + fw(".. class:: %s\n\n" % struct_id) fw(" %s\n\n" % struct.description) @@ -811,7 +818,15 @@ def pyrna2sphinx(BASEPATH): sorted_struct_properties = struct.properties[:] sorted_struct_properties.sort(key=lambda prop: prop.identifier) + # support blacklisting props + struct_blacklist = RNA_BLACKLIST.get(struct_id, ()) + for prop in sorted_struct_properties: + + # support blacklisting props + if prop.identifier in struct_blacklist: + continue + type_descr = prop.get_type_description(class_fmt=":class:`%s`", collection_id=_BPY_PROP_COLLECTION_ID) # readonly properties use "data" directive, variables properties use "attribute" directive if 'readonly' in type_descr: @@ -860,7 +875,7 @@ def pyrna2sphinx(BASEPATH): descr = prop.name fw(" `%s`, %s, %s\n\n" % (prop.identifier, descr, type_descr)) - write_example_ref(" ", fw, "bpy.types." + struct.identifier + "." + func.identifier) + write_example_ref(" ", fw, "bpy.types." + struct_id + "." + func.identifier) fw("\n") @@ -876,7 +891,7 @@ def pyrna2sphinx(BASEPATH): py_func = None for identifier, py_func in py_funcs: - py_c_func2sphinx(" ", fw, "bpy.types", struct.identifier, identifier, py_func, is_class=True) + py_c_func2sphinx(" ", fw, "bpy.types", struct_id, identifier, py_func, is_class=True) lines = [] @@ -955,7 +970,7 @@ def pyrna2sphinx(BASEPATH): fw("\n") # docs last?, disable for now - # write_example_ref("", fw, "bpy.types.%s" % struct.identifier) + # write_example_ref("", fw, "bpy.types.%s" % struct_id) file.close() if "bpy.types" not in EXCLUDE_MODULES: diff --git a/extern/libmv/SConscript b/extern/libmv/SConscript index 60705e913f7..9c134934fa0 100644 --- a/extern/libmv/SConscript +++ b/extern/libmv/SConscript @@ -46,16 +46,16 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): defs.append('NDEBUG') else: if not env['BF_DEBUG']: - cflags_libmv = Split(env['REL_CFLAGS']) - ccflags_libmv = Split(env['REL_CCFLAGS']) - cxxflags_libmv = Split(env['REL_CXXFLAGS']) + cflags_libmv += Split(env['REL_CFLAGS']) + ccflags_libmv += Split(env['REL_CCFLAGS']) + cxxflags_libmv += Split(env['REL_CXXFLAGS']) else: src += env.Glob("third_party/glog/src/*.cc") incs += ' ./third_party/glog/src' if not env['BF_DEBUG']: - cflags_libmv = Split(env['REL_CFLAGS']) - ccflags_libmv = Split(env['REL_CCFLAGS']) - cxxflags_libmv = Split(env['REL_CXXFLAGS']) + cflags_libmv += Split(env['REL_CFLAGS']) + ccflags_libmv += Split(env['REL_CCFLAGS']) + cxxflags_libmv += Split(env['REL_CXXFLAGS']) incs += ' ./third_party/ssba ./third_party/ldl/Include ../colamd/Include' diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py index 5b724565481..269871b7230 100644 --- a/release/scripts/startup/bl_operators/clip.py +++ b/release/scripts/startup/bl_operators/clip.py @@ -19,9 +19,7 @@ # import bpy import os -import shutil from bpy.types import Operator -from bpy_extras.io_utils import unpack_list, unpack_face_list from mathutils import Vector, Matrix @@ -128,6 +126,8 @@ class CLIP_OT_bundles_to_mesh(Operator): return (sc.type == 'CLIP_EDITOR') and sc.clip def execute(self, context): + from bpy_extras.io_utils import unpack_list + sc = context.space_data clip = sc.clip @@ -171,6 +171,8 @@ class CLIP_OT_delete_proxy(Operator): return wm.invoke_confirm(self, event) def _rmproxy(self, abspath): + import shutil + if not os.path.exists(abspath): return @@ -648,6 +650,8 @@ class CLIP_OT_setup_tracking_scene(Operator): @staticmethod def _createMesh(scene, name, vertices, faces): + from bpy_extras.io_utils import unpack_list, unpack_face_list + mesh = bpy.data.meshes.new(name=name) mesh.vertices.add(len(vertices)) diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 4e52aeb03d2..fa59cc0ac53 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -36,9 +36,9 @@ class MESH_MT_vertex_group_specials(Menu): layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT') layout.operator("object.vertex_group_remove", icon='X', text="Delete All").all = True layout.separator() - layout.operator("object.vertex_group_lock", icon='LOCK', text="Lock All").action = 'SELECT' - layout.operator("object.vertex_group_lock", icon='UNLOCK', text="UnLock All").action = 'DESELECT' - layout.operator("object.vertex_group_lock", icon='LOCK', text="Lock Invert All").action = 'INVERT' + layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All").action = 'SELECT' + layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="UnLock All").action = 'DESELECT' + layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock Invert All").action = 'INVERT' class MESH_MT_shape_key_specials(Menu): diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 8e83eb5e7b8..f6aab54f397 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1763,7 +1763,7 @@ class VIEW3D_MT_edit_curve_ctrlpoints(Menu): edit_object = context.edit_object if edit_object.type == 'CURVE': - layout.operator("transform.transform", text="Tilt").mode = 'TILT' + layout.operator("transform.tilt") layout.operator("curve.tilt_clear") layout.operator("curve.separate") diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c index 4da67f59ff7..b82393fad92 100644 --- a/source/blender/blenfont/intern/blf_dir.c +++ b/source/blender/blenfont/intern/blf_dir.c @@ -129,7 +129,7 @@ void BLF_dir_free(char **dirs, int count) char *blf_dir_search(const char *file) { DirBLF *dir; - char full_path[FILE_MAXDIR+FILE_MAXFILE]; + char full_path[FILE_MAX]; char *s= NULL; for(dir=global_font_dir.first; dir; dir= dir->next) { diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 819d6de70e9..ad9c65c4523 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -612,7 +612,7 @@ int editbmesh_get_first_deform_matrices(struct Scene *, struct Object *, struct int sculpt_get_deform_matrices(struct Scene *scene, struct Object *ob, float (**deformmats)[3][3], float (**deformcos)[3]); -void weight_to_rgb(float input, float *fr, float *fg, float *fb); +void weight_to_rgb(float r_rgb[3], const float weight); /* convert layers requested by a GLSL material to actually available layers in * the DerivedMesh, with both a pointer for arrays and an offset for editmesh */ diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index 9ff42bc706b..c829fc69b05 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -60,10 +60,10 @@ char BKE_ftype_to_imtype(const int ftype); int BKE_imtype_to_ftype(char imtype); int BKE_imtype_is_movie(const char imtype); -int BKE_imtype_supports_alpha(const char imtype); int BKE_imtype_supports_zbuf(const char imtype); int BKE_imtype_supports_compress(const char imtype); int BKE_imtype_supports_quality(const char imtype); +char BKE_imtype_valid_channels(const char imtype); char BKE_imtype_valid_depths(const char imtype); char BKE_imtype_from_arg(const char *arg); @@ -115,6 +115,10 @@ struct RenderResult; /* image-user gets a new image, check settings */ #define IMA_SIGNAL_USER_NEW_IMAGE 6 +#define IMA_CHAN_FLAG_BW 1 +#define IMA_CHAN_FLAG_RGB 2 +#define IMA_CHAN_FLAG_ALPHA 4 + /* depending Image type, and (optional) ImageUser setting it returns ibuf */ /* always call to make signals work */ struct ImBuf *BKE_image_get_ibuf(struct Image *ima, struct ImageUser *iuser); diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index 8e7645d721e..0079ecb7d9c 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -91,7 +91,7 @@ void end_render_materials(struct Main *); int material_in_material(struct Material *parmat, struct Material *mat); -void ramp_blend(int type, float *r, float *g, float *b, float fac, const float col[3]); +void ramp_blend(int type, float r_col[3], const float fac, const float col[3]); /* copy/paste */ void clear_matcopybuf(void); diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index c66e49f2906..f491761f3f2 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -217,7 +217,7 @@ typedef struct ParticleDrawData { float *ndata, *nd; /* normal data */ float *cdata, *cd; /* color data */ float *vedata, *ved; /* velocity data */ - float *ma_r, *ma_g, *ma_b; + float *ma_col; int tot_vec_size, flag; int totpoint, totve; } ParticleDrawData; diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index 9f4fae7dc2e..d1b0acf7142 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -127,6 +127,9 @@ typedef struct PTCacheID { unsigned int stack_index; unsigned int flag; + unsigned int default_step; + unsigned int max_step; + /* flags defined in DNA_object_force.h */ unsigned int data_types, info_types; diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 175e74cdd3e..10fb7af90f8 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -844,31 +844,29 @@ static void add_orco_dm(Object *ob, BMEditMesh *em, DerivedMesh *dm, * happens on enter/exit wpaint. */ -void weight_to_rgb(float input, float *fr, float *fg, float *fb) +void weight_to_rgb(float r_rgb[3], const float weight) { - float blend; - - blend= ((input/2.0f)+0.5f); - - if (input<=0.25f){ // blue->cyan - *fr= 0.0f; - *fg= blend*input*4.0f; - *fb= blend; + const float blend= ((weight/2.0f)+0.5f); + + if (weight<=0.25f){ // blue->cyan + r_rgb[0]= 0.0f; + r_rgb[1]= blend*weight*4.0f; + r_rgb[2]= blend; } - else if (input<=0.50f){ // cyan->green - *fr= 0.0f; - *fg= blend; - *fb= blend*(1.0f-((input-0.25f)*4.0f)); + else if (weight<=0.50f){ // cyan->green + r_rgb[0]= 0.0f; + r_rgb[1]= blend; + r_rgb[2]= blend*(1.0f-((weight-0.25f)*4.0f)); } - else if (input <= 0.75f){ // green->yellow - *fr= blend * ((input-0.50f)*4.0f); - *fg= blend; - *fb= 0.0f; + else if (weight <= 0.75f){ // green->yellow + r_rgb[0]= blend * ((weight-0.50f)*4.0f); + r_rgb[1]= blend; + r_rgb[2]= 0.0f; } - else if (input <= 1.0f){ // yellow->red - *fr= blend; - *fg= blend * (1.0f-((input-0.75f)*4.0f)); - *fb= 0.0f; + else if (weight <= 1.0f){ // yellow->red + r_rgb[0]= blend; + r_rgb[1]= blend * (1.0f-((weight-0.75f)*4.0f)); + r_rgb[2]= 0.0f; } } @@ -933,7 +931,7 @@ static void calc_weightpaint_vert_color(Object *ob, ColorBand *coba, int vert, u if(coba) do_colorband(coba, input, colf); else - weight_to_rgb(input, colf, colf+1, colf+2); + weight_to_rgb(colf, input); col[3] = (unsigned char)(colf[0] * 255.0f); col[2] = (unsigned char)(colf[1] * 255.0f); diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index af31da7af1e..9534dfd9d0b 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -452,7 +452,7 @@ int blender_test_break(void) #define MAXUNDONAME 64 typedef struct UndoElem { struct UndoElem *next, *prev; - char str[FILE_MAXDIR+FILE_MAXFILE]; + char str[FILE_MAX]; char name[MAXUNDONAME]; MemFile memfile; uintptr_t undosize; @@ -537,7 +537,7 @@ void BKE_write_undo(bContext *C, const char *name) /* disk save version */ if(UNDO_DISK) { static int counter= 0; - char filepath[FILE_MAXDIR+FILE_MAXFILE]; + char filepath[FILE_MAX]; char numstr[32]; int fileflags = G.fileflags & ~(G_FILE_HISTORY); /* don't do file history on undo */ diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index b605b0722e9..f61254581ac 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -1681,7 +1681,7 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData for (; j<((mface[i].v4)?4:3); j++) { int index = (j==0)?mface[i].v1: (j==1)?mface[i].v2: (j==2)?mface[i].v3: mface[i].v4; - weight_to_rgb(weight[index], temp_color, temp_color+1, temp_color+2); + weight_to_rgb(temp_color, weight[index]); col[i*4+j].r = FTOCHAR(temp_color[2]); col[i*4+j].g = FTOCHAR(temp_color[1]); col[i*4+j].b = FTOCHAR(temp_color[0]); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 034177e2b5d..c7f74f37a2d 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -900,24 +900,6 @@ int BKE_imtype_is_movie(const char imtype) return 0; } -int BKE_imtype_supports_alpha(const char imtype) -{ - switch(imtype) { - case R_IMF_IMTYPE_TARGA: - case R_IMF_IMTYPE_IRIS: - case R_IMF_IMTYPE_PNG: - /* case R_IMF_IMTYPE_BMP: */ /* read but not write */ - case R_IMF_IMTYPE_RADHDR: - case R_IMF_IMTYPE_TIFF: - case R_IMF_IMTYPE_OPENEXR: - case R_IMF_IMTYPE_MULTILAYER: - case R_IMF_IMTYPE_DDS: - case R_IMF_IMTYPE_JP2: - return 1; - } - return 0; -} - int BKE_imtype_supports_zbuf(const char imtype) { switch(imtype) { @@ -948,6 +930,39 @@ int BKE_imtype_supports_quality(const char imtype) return 0; } +char BKE_imtype_valid_channels(const char imtype) +{ + char chan_flag= IMA_CHAN_FLAG_RGB; /* assume all support rgb */ + + /* alpha */ + switch(imtype) { + case R_IMF_IMTYPE_TARGA: + case R_IMF_IMTYPE_IRIS: + case R_IMF_IMTYPE_PNG: + /* case R_IMF_IMTYPE_BMP: */ /* read but not write */ + case R_IMF_IMTYPE_RADHDR: + case R_IMF_IMTYPE_TIFF: + case R_IMF_IMTYPE_OPENEXR: + case R_IMF_IMTYPE_MULTILAYER: + case R_IMF_IMTYPE_DDS: + case R_IMF_IMTYPE_JP2: + chan_flag |= IMA_CHAN_FLAG_ALPHA; + } + + /* bw */ + switch(imtype) { + case R_IMF_IMTYPE_PNG: + case R_IMF_IMTYPE_JPEG90: + case R_IMF_IMTYPE_TARGA: + case R_IMF_IMTYPE_RAWTGA: + case R_IMF_IMTYPE_TIFF: + case R_IMF_IMTYPE_IRIS: + chan_flag |= IMA_CHAN_FLAG_BW; + } + + return chan_flag; +} + char BKE_imtype_valid_depths(const char imtype) { switch (imtype) { diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 48c6d6b2a19..fa0e886b784 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1180,129 +1180,129 @@ int object_remove_material_slot(Object *ob) /* r g b = current value, col = new value, fac==0 is no change */ /* if g==NULL, it only does r channel */ -void ramp_blend(int type, float *r, float *g, float *b, float fac, const float col[3]) +void ramp_blend(int type, float r_col[3], const float fac, const float col[3]) { float tmp, facm= 1.0f-fac; switch (type) { case MA_RAMP_BLEND: - *r = facm*(*r) + fac*col[0]; - if(g) { - *g = facm*(*g) + fac*col[1]; - *b = facm*(*b) + fac*col[2]; + r_col[0] = facm*(r_col[0]) + fac*col[0]; + if(r_col[1]) { + r_col[1] = facm*(r_col[1]) + fac*col[1]; + r_col[2] = facm*(r_col[2]) + fac*col[2]; } break; case MA_RAMP_ADD: - *r += fac*col[0]; - if(g) { - *g += fac*col[1]; - *b += fac*col[2]; + r_col[0] += fac*col[0]; + if(r_col[1]) { + r_col[1] += fac*col[1]; + r_col[2] += fac*col[2]; } break; case MA_RAMP_MULT: - *r *= (facm + fac*col[0]); - if(g) { - *g *= (facm + fac*col[1]); - *b *= (facm + fac*col[2]); + r_col[0] *= (facm + fac*col[0]); + if(r_col[1]) { + r_col[1] *= (facm + fac*col[1]); + r_col[2] *= (facm + fac*col[2]); } break; case MA_RAMP_SCREEN: - *r = 1.0f - (facm + fac*(1.0f - col[0])) * (1.0f - *r); - if(g) { - *g = 1.0f - (facm + fac*(1.0f - col[1])) * (1.0f - *g); - *b = 1.0f - (facm + fac*(1.0f - col[2])) * (1.0f - *b); + r_col[0] = 1.0f - (facm + fac*(1.0f - col[0])) * (1.0f - r_col[0]); + if(r_col[1]) { + r_col[1] = 1.0f - (facm + fac*(1.0f - col[1])) * (1.0f - r_col[1]); + r_col[2] = 1.0f - (facm + fac*(1.0f - col[2])) * (1.0f - r_col[2]); } break; case MA_RAMP_OVERLAY: - if(*r < 0.5f) - *r *= (facm + 2.0f*fac*col[0]); + if(r_col[0] < 0.5f) + r_col[0] *= (facm + 2.0f*fac*col[0]); else - *r = 1.0f - (facm + 2.0f*fac*(1.0f - col[0])) * (1.0f - *r); - if(g) { - if(*g < 0.5f) - *g *= (facm + 2.0f*fac*col[1]); + r_col[0] = 1.0f - (facm + 2.0f*fac*(1.0f - col[0])) * (1.0f - r_col[0]); + if(r_col[1]) { + if(r_col[1] < 0.5f) + r_col[1] *= (facm + 2.0f*fac*col[1]); else - *g = 1.0f - (facm + 2.0f*fac*(1.0f - col[1])) * (1.0f - *g); - if(*b < 0.5f) - *b *= (facm + 2.0f*fac*col[2]); + r_col[1] = 1.0f - (facm + 2.0f*fac*(1.0f - col[1])) * (1.0f - r_col[1]); + if(r_col[2] < 0.5f) + r_col[2] *= (facm + 2.0f*fac*col[2]); else - *b = 1.0f - (facm + 2.0f*fac*(1.0f - col[2])) * (1.0f - *b); + r_col[2] = 1.0f - (facm + 2.0f*fac*(1.0f - col[2])) * (1.0f - r_col[2]); } break; case MA_RAMP_SUB: - *r -= fac*col[0]; - if(g) { - *g -= fac*col[1]; - *b -= fac*col[2]; + r_col[0] -= fac*col[0]; + if(r_col[1]) { + r_col[1] -= fac*col[1]; + r_col[2] -= fac*col[2]; } break; case MA_RAMP_DIV: if(col[0]!=0.0f) - *r = facm*(*r) + fac*(*r)/col[0]; - if(g) { + r_col[0] = facm*(r_col[0]) + fac*(r_col[0])/col[0]; + if(r_col[1]) { if(col[1]!=0.0f) - *g = facm*(*g) + fac*(*g)/col[1]; + r_col[1] = facm*(r_col[1]) + fac*(r_col[1])/col[1]; if(col[2]!=0.0f) - *b = facm*(*b) + fac*(*b)/col[2]; + r_col[2] = facm*(r_col[2]) + fac*(r_col[2])/col[2]; } break; case MA_RAMP_DIFF: - *r = facm*(*r) + fac*fabsf(*r-col[0]); - if(g) { - *g = facm*(*g) + fac*fabsf(*g-col[1]); - *b = facm*(*b) + fac*fabsf(*b-col[2]); + r_col[0] = facm*(r_col[0]) + fac*fabsf(r_col[0]-col[0]); + if(r_col[1]) { + r_col[1] = facm*(r_col[1]) + fac*fabsf(r_col[1]-col[1]); + r_col[2] = facm*(r_col[2]) + fac*fabsf(r_col[2]-col[2]); } break; case MA_RAMP_DARK: tmp=col[0]+((1-col[0])*facm); - if(tmp < *r) *r= tmp; - if(g) { + if(tmp < r_col[0]) r_col[0]= tmp; + if(r_col[1]) { tmp=col[1]+((1-col[1])*facm); - if(tmp < *g) *g= tmp; + if(tmp < r_col[1]) r_col[1]= tmp; tmp=col[2]+((1-col[2])*facm); - if(tmp < *b) *b= tmp; + if(tmp < r_col[2]) r_col[2]= tmp; } break; case MA_RAMP_LIGHT: tmp= fac*col[0]; - if(tmp > *r) *r= tmp; - if(g) { + if(tmp > r_col[0]) r_col[0]= tmp; + if(r_col[1]) { tmp= fac*col[1]; - if(tmp > *g) *g= tmp; + if(tmp > r_col[1]) r_col[1]= tmp; tmp= fac*col[2]; - if(tmp > *b) *b= tmp; + if(tmp > r_col[2]) r_col[2]= tmp; } break; case MA_RAMP_DODGE: - if(*r !=0.0f){ + if(r_col[0] !=0.0f){ tmp = 1.0f - fac*col[0]; if(tmp <= 0.0f) - *r = 1.0f; - else if ((tmp = (*r) / tmp)> 1.0f) - *r = 1.0f; + r_col[0] = 1.0f; + else if ((tmp = (r_col[0]) / tmp)> 1.0f) + r_col[0] = 1.0f; else - *r = tmp; + r_col[0] = tmp; } - if(g) { - if(*g !=0.0f){ + if(r_col[1]) { + if(r_col[1] !=0.0f){ tmp = 1.0f - fac*col[1]; if(tmp <= 0.0f ) - *g = 1.0f; - else if ((tmp = (*g) / tmp) > 1.0f ) - *g = 1.0f; + r_col[1] = 1.0f; + else if ((tmp = (r_col[1]) / tmp) > 1.0f ) + r_col[1] = 1.0f; else - *g = tmp; + r_col[1] = tmp; } - if(*b !=0.0f){ + if(r_col[2] !=0.0f){ tmp = 1.0f - fac*col[2]; if(tmp <= 0.0f) - *b = 1.0f; - else if ((tmp = (*b) / tmp) > 1.0f ) - *b = 1.0f; + r_col[2] = 1.0f; + else if ((tmp = (r_col[2]) / tmp) > 1.0f ) + r_col[2] = 1.0f; else - *b = tmp; + r_col[2] = tmp; } } @@ -1312,114 +1312,114 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, const float c tmp = facm + fac*col[0]; if(tmp <= 0.0f) - *r = 0.0f; - else if (( tmp = (1.0f - (1.0f - (*r)) / tmp )) < 0.0f) - *r = 0.0f; + r_col[0] = 0.0f; + else if (( tmp = (1.0f - (1.0f - (r_col[0])) / tmp )) < 0.0f) + r_col[0] = 0.0f; else if (tmp > 1.0f) - *r=1.0f; + r_col[0]=1.0f; else - *r = tmp; + r_col[0] = tmp; - if(g) { + if(r_col[1]) { tmp = facm + fac*col[1]; if(tmp <= 0.0f) - *g = 0.0f; - else if (( tmp = (1.0f - (1.0f - (*g)) / tmp )) < 0.0f ) - *g = 0.0f; + r_col[1] = 0.0f; + else if (( tmp = (1.0f - (1.0f - (r_col[1])) / tmp )) < 0.0f ) + r_col[1] = 0.0f; else if(tmp >1.0f) - *g=1.0f; + r_col[1]=1.0f; else - *g = tmp; + r_col[1] = tmp; tmp = facm + fac*col[2]; if(tmp <= 0.0f) - *b = 0.0f; - else if (( tmp = (1.0f - (1.0f - (*b)) / tmp )) < 0.0f ) - *b = 0.0f; + r_col[2] = 0.0f; + else if (( tmp = (1.0f - (1.0f - (r_col[2])) / tmp )) < 0.0f ) + r_col[2] = 0.0f; else if(tmp >1.0f) - *b= 1.0f; + r_col[2]= 1.0f; else - *b = tmp; + r_col[2] = tmp; } break; case MA_RAMP_HUE: - if(g){ + if(r_col[1]){ float rH,rS,rV; float colH,colS,colV; float tmpr,tmpg,tmpb; rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV); if(colS!=0 ){ - rgb_to_hsv(*r,*g,*b,&rH,&rS,&rV); + rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV); hsv_to_rgb( colH , rS, rV, &tmpr, &tmpg, &tmpb); - *r = facm*(*r) + fac*tmpr; - *g = facm*(*g) + fac*tmpg; - *b = facm*(*b) + fac*tmpb; + r_col[0] = facm*(r_col[0]) + fac*tmpr; + r_col[1] = facm*(r_col[1]) + fac*tmpg; + r_col[2] = facm*(r_col[2]) + fac*tmpb; } } break; case MA_RAMP_SAT: - if(g){ + if(r_col[1]){ float rH,rS,rV; float colH,colS,colV; - rgb_to_hsv(*r,*g,*b,&rH,&rS,&rV); + rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV); if(rS!=0){ rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV); - hsv_to_rgb( rH, (facm*rS +fac*colS), rV, r, g, b); + hsv_to_rgb( rH, (facm*rS +fac*colS), rV, r_col+0, r_col+1, r_col+2); } } break; case MA_RAMP_VAL: - if(g){ + if(r_col[1]){ float rH,rS,rV; float colH,colS,colV; - rgb_to_hsv(*r,*g,*b,&rH,&rS,&rV); + rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV); rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV); - hsv_to_rgb( rH, rS, (facm*rV +fac*colV), r, g, b); + hsv_to_rgb( rH, rS, (facm*rV +fac*colV), r_col+0, r_col+1, r_col+2); } break; case MA_RAMP_COLOR: - if(g){ + if(r_col[1]){ float rH,rS,rV; float colH,colS,colV; float tmpr,tmpg,tmpb; rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV); if(colS!=0){ - rgb_to_hsv(*r,*g,*b,&rH,&rS,&rV); + rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV); hsv_to_rgb( colH, colS, rV, &tmpr, &tmpg, &tmpb); - *r = facm*(*r) + fac*tmpr; - *g = facm*(*g) + fac*tmpg; - *b = facm*(*b) + fac*tmpb; + r_col[0] = facm*(r_col[0]) + fac*tmpr; + r_col[1] = facm*(r_col[1]) + fac*tmpg; + r_col[2] = facm*(r_col[2]) + fac*tmpb; } } break; case MA_RAMP_SOFT: - if (g){ + if (r_col[1]){ float scr, scg, scb; /* first calculate non-fac based Screen mix */ - scr = 1.0f - (1.0f - col[0]) * (1.0f - *r); - scg = 1.0f - (1.0f - col[1]) * (1.0f - *g); - scb = 1.0f - (1.0f - col[2]) * (1.0f - *b); + scr = 1.0f - (1.0f - col[0]) * (1.0f - r_col[0]); + scg = 1.0f - (1.0f - col[1]) * (1.0f - r_col[1]); + scb = 1.0f - (1.0f - col[2]) * (1.0f - r_col[2]); - *r = facm*(*r) + fac*(((1.0f - *r) * col[0] * (*r)) + (*r * scr)); - *g = facm*(*g) + fac*(((1.0f - *g) * col[1] * (*g)) + (*g * scg)); - *b = facm*(*b) + fac*(((1.0f - *b) * col[2] * (*b)) + (*b * scb)); + r_col[0] = facm*(r_col[0]) + fac*(((1.0f - r_col[0]) * col[0] * (r_col[0])) + (r_col[0] * scr)); + r_col[1] = facm*(r_col[1]) + fac*(((1.0f - r_col[1]) * col[1] * (r_col[1])) + (r_col[1] * scg)); + r_col[2] = facm*(r_col[2]) + fac*(((1.0f - r_col[2]) * col[2] * (r_col[2])) + (r_col[2] * scb)); } break; case MA_RAMP_LINEAR: if (col[0] > 0.5f) - *r = *r + fac*(2.0f*(col[0]-0.5f)); + r_col[0] = r_col[0] + fac*(2.0f*(col[0]-0.5f)); else - *r = *r + fac*(2.0f*(col[0]) - 1.0f); - if (g){ + r_col[0] = r_col[0] + fac*(2.0f*(col[0]) - 1.0f); + if (r_col[1]){ if (col[1] > 0.5f) - *g = *g + fac*(2.0f*(col[1]-0.5f)); + r_col[1] = r_col[1] + fac*(2.0f*(col[1]-0.5f)); else - *g = *g + fac*(2.0f*(col[1]) -1.0f); + r_col[1] = r_col[1] + fac*(2.0f*(col[1]) -1.0f); if (col[2] > 0.5f) - *b = *b + fac*(2.0f*(col[2]-0.5f)); + r_col[2] = r_col[2] + fac*(2.0f*(col[2]-0.5f)); else - *b = *b + fac*(2.0f*(col[2]) - 1.0f); + r_col[2] = r_col[2] + fac*(2.0f*(col[2]) - 1.0f); } break; } diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 12a2fe28bc8..382e1d70387 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -895,7 +895,7 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, int proxy_render_size, int undistorted) { - char name[FILE_MAXFILE+FILE_MAXDIR]; + char name[FILE_MAX]; int quality, rectx, recty; int size= size= rendersize_to_number(proxy_render_size); ImBuf *scaleibuf; diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index ea1dbec8a27..7be8aefc883 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -168,7 +168,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename, const char { PackedFile *pf = NULL; int file, filelen; - char name[FILE_MAXDIR+FILE_MAXFILE]; + char name[FILE_MAX]; void *data; /* render result has no filename and can be ignored @@ -245,7 +245,7 @@ void packAll(Main *bmain, ReportList *reports) static char *find_new_name(char *name) { - char tempname[FILE_MAXDIR + FILE_MAXFILE]; + char tempname[FILE_MAX]; char *newname; size_t len; @@ -268,8 +268,8 @@ int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, i { int file, number, remove_tmp = FALSE; int ret_value = RET_OK; - char name[FILE_MAXDIR + FILE_MAXFILE]; - char tempname[FILE_MAXDIR + FILE_MAXFILE]; + char name[FILE_MAX]; + char tempname[FILE_MAX]; /* void *data; */ if (guimode) {} //XXX waitcursor(1); @@ -337,7 +337,7 @@ int checkPackedFile(const char *filename, PackedFile *pf) struct stat st; int ret_val, i, len, file; char buf[4096]; - char name[FILE_MAXDIR + FILE_MAXFILE]; + char name[FILE_MAX]; BLI_strncpy(name, filename, sizeof(name)); BLI_path_abs(name, G.main->name); @@ -394,8 +394,8 @@ char *unpackFile(ReportList *reports, const char *abs_name, const char *local_na char *newname = NULL; const char *temp = NULL; - // char newabs[FILE_MAXDIR + FILE_MAXFILE]; - // char newlocal[FILE_MAXDIR + FILE_MAXFILE]; + // char newabs[FILE_MAX]; + // char newlocal[FILE_MAX]; if (pf != NULL) { switch (how) { @@ -445,7 +445,7 @@ char *unpackFile(ReportList *reports, const char *abs_name, const char *local_na int unpackVFont(ReportList *reports, VFont *vfont, int how) { - char localname[FILE_MAXDIR + FILE_MAXFILE], fi[FILE_MAXFILE]; + char localname[FILE_MAX], fi[FILE_MAXFILE]; char *newname; int ret_value = RET_ERROR; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 8f50fb25f45..d61541155bf 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3172,13 +3172,13 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf float t2; if(k==0) { - weight_to_rgb(pind.hkey[1]->weight, ca->col, ca->col+1, ca->col+2); + weight_to_rgb(ca->col, pind.hkey[1]->weight); } else { float w1[3], w2[3]; keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time)); - weight_to_rgb(pind.hkey[0]->weight, w1, w1+1, w1+2); - weight_to_rgb(pind.hkey[1]->weight, w2, w2+1, w2+2); + weight_to_rgb(w1, pind.hkey[0]->weight); + weight_to_rgb(w2, pind.hkey[1]->weight); interp_v3_v3v3(ca->col, w1, w2, keytime); } diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 8ac492635f1..868a3722a6c 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -770,6 +770,9 @@ void BKE_ptcache_id_from_softbody(PTCacheID *pid, Object *ob, SoftBody *sb) pid->info_types= 0; pid->stack_index = pid->cache->index; + + pid->default_step = 10; + pid->max_step = 20; } void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *psys) { @@ -820,6 +823,9 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *p pid->data_types|= (1<info_types= (1<default_step = 10; + pid->max_step = 20; } void BKE_ptcache_id_from_cloth(PTCacheID *pid, Object *ob, ClothModifierData *clmd) { @@ -850,6 +856,9 @@ void BKE_ptcache_id_from_cloth(PTCacheID *pid, Object *ob, ClothModifierData *cl pid->data_types= (1<info_types= 0; + + pid->default_step = 1; + pid->max_step = 1; } void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd) { @@ -890,6 +899,9 @@ void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeMo pid->data_types |= (1<wt) pid->data_types |= (1<default_step = 1; + pid->max_step = 1; } void BKE_ptcache_id_from_dynamicpaint(PTCacheID *pid, Object *ob, DynamicPaintSurface *surface) @@ -923,6 +935,9 @@ void BKE_ptcache_id_from_dynamicpaint(PTCacheID *pid, Object *ob, DynamicPaintSu pid->info_types= 0; pid->stack_index = pid->cache->index; + + pid->default_step = 1; + pid->max_step = 1; } void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int duplis) @@ -1018,7 +1033,7 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup */ #define MAX_PTCACHE_PATH FILE_MAX -#define MAX_PTCACHE_FILE ((FILE_MAXDIR+FILE_MAXFILE)*2) +#define MAX_PTCACHE_FILE ((FILE_MAX)*2) static int ptcache_path(PTCacheID *pid, char *filename) { @@ -1112,7 +1127,7 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra) { PTCacheFile *pf; FILE *fp = NULL; - char filename[(FILE_MAXDIR+FILE_MAXFILE)*2]; + char filename[(FILE_MAX)*2]; #ifndef DURIAN_POINTCACHE_LIB_OK /* don't allow writing for linked objects */ diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 880bdbfaa96..249555578f0 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -652,7 +652,7 @@ void calc_sequence(Scene *scene, Sequence *seq) /* note: caller should run calc_sequence(scene, seq) after */ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range) { - char str[FILE_MAXDIR+FILE_MAXFILE]; + char str[FILE_MAX]; int prev_startdisp=0, prev_enddisp=0; /* note: dont rename the strip, will break animation curves */ @@ -1156,7 +1156,7 @@ static IMB_Proxy_Size seq_rendersize_to_proxysize(int size) static void seq_open_anim_file(Sequence * seq) { - char name[FILE_MAXDIR+FILE_MAXFILE]; + char name[FILE_MAX]; StripProxy * proxy; if(seq->anim != NULL) { @@ -2057,7 +2057,7 @@ static ImBuf * seq_render_scene_strip_impl( static ImBuf * seq_render_strip(SeqRenderData context, Sequence * seq, float cfra) { ImBuf * ibuf = NULL; - char name[FILE_MAXDIR+FILE_MAXFILE]; + char name[FILE_MAX]; int use_preprocess = input_have_to_preprocess(context, seq, cfra); float nr = give_stripelem_index(seq, cfra); /* all effects are handled similarly with the exception of speed effect */ diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 5735a95764b..28d68892a2a 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -237,12 +237,12 @@ int reopen_text(Text *text) int i, llen, len; unsigned char *buffer; TextLine *tmp; - char str[FILE_MAXDIR+FILE_MAXFILE]; + char str[FILE_MAX]; struct stat st; if (!text || !text->name) return 0; - BLI_strncpy(str, text->name, FILE_MAXDIR+FILE_MAXFILE); + BLI_strncpy(str, text->name, FILE_MAX); BLI_path_abs(str, G.main->name); fp= fopen(str, "r"); @@ -334,10 +334,10 @@ Text *add_text(const char *file, const char *relpath) unsigned char *buffer; TextLine *tmp; Text *ta; - char str[FILE_MAXDIR+FILE_MAXFILE]; + char str[FILE_MAX]; struct stat st; - BLI_strncpy(str, file, FILE_MAXDIR+FILE_MAXFILE); + BLI_strncpy(str, file, FILE_MAX); if (relpath) /* can be NULL (bg mode) */ BLI_path_abs(str, relpath); diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 217e7687092..ebb3937dd91 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -427,8 +427,8 @@ void BLI_cleanup_file(const char *relabase, char *dir) void BLI_path_rel(char *file, const char *relfile) { char * lslash; - char temp[FILE_MAXDIR+FILE_MAXFILE]; - char res[FILE_MAXDIR+FILE_MAXFILE]; + char temp[FILE_MAX]; + char res[FILE_MAX]; /* if file is already relative, bail out */ if(file[0]=='/' && file[1]=='/') return; @@ -446,9 +446,9 @@ void BLI_path_rel(char *file, const char *relfile) if (relfile[0] != '\\' && relfile[0] != '/') { ptemp++; } - BLI_strncpy(ptemp, relfile, FILE_MAXDIR + FILE_MAXFILE-3); + BLI_strncpy(ptemp, relfile, FILE_MAX-3); } else { - BLI_strncpy(temp, relfile, FILE_MAXDIR + FILE_MAXFILE); + BLI_strncpy(temp, relfile, FILE_MAX); } if (BLI_strnlen(file, 3) > 2) { @@ -540,7 +540,7 @@ int BLI_has_parent(char *path) int BLI_parent_dir(char *path) { static char parent_dir[]= {'.', '.', SEP, '\0'}; /* "../" or "..\\" */ - char tmp[FILE_MAXDIR+FILE_MAXFILE+4]; + char tmp[FILE_MAX+4]; BLI_strncpy(tmp, path, sizeof(tmp)-4); BLI_add_slash(tmp); strcat(tmp, parent_dir); @@ -745,7 +745,7 @@ int BLI_path_cwd(char *path) #endif if (wasrelative==1) { - char cwd[FILE_MAXDIR + FILE_MAXFILE]= ""; + char cwd[FILE_MAX]= ""; BLI_current_working_dir(cwd, sizeof(cwd)); /* incase the full path to the blend isnt used */ if (cwd[0] == '\0') { @@ -758,8 +758,8 @@ int BLI_path_cwd(char *path) * blend file which isnt a feature we want to use in this case since were dealing * with a path from the command line, rather than from inside Blender */ - char origpath[FILE_MAXDIR + FILE_MAXFILE]; - BLI_strncpy(origpath, path, FILE_MAXDIR + FILE_MAXFILE); + char origpath[FILE_MAX]; + BLI_strncpy(origpath, path, FILE_MAX); BLI_make_file_string(NULL, path, cwd, origpath); } @@ -1257,7 +1257,7 @@ void BLI_make_exist(char *dir) void BLI_make_existing_file(const char *name) { - char di[FILE_MAXDIR+FILE_MAXFILE], fi[FILE_MAXFILE]; + char di[FILE_MAX], fi[FILE_MAXFILE]; BLI_strncpy(di, name, sizeof(di)); BLI_splitdirstring(di, fi); @@ -1706,8 +1706,8 @@ static int add_win32_extension(char *name) type = BLI_exists(name); if ((type == 0) || S_ISDIR(type)) { #ifdef _WIN32 - char filename[FILE_MAXDIR+FILE_MAXFILE]; - char ext[FILE_MAXDIR+FILE_MAXFILE]; + char filename[FILE_MAX]; + char ext[FILE_MAX]; const char *extensions = getenv("PATHEXT"); if (extensions) { char *temp; @@ -1753,7 +1753,7 @@ static int add_win32_extension(char *name) */ static void bli_where_am_i(char *fullname, const size_t maxlen, const char *name) { - char filename[FILE_MAXDIR+FILE_MAXFILE]; + char filename[FILE_MAX]; const char *path = NULL, *temp; #ifdef _WIN32 diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 86095e6b909..1ef254d355f 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -442,18 +442,18 @@ int BLI_exists(const char *name) /* in Windows stat doesn't recognize dir ending on a slash To not break code where the ending slash is expected we don't mess with the argument name directly here - elubie */ - char tmp[FILE_MAXDIR+FILE_MAXFILE]; + char tmp[FILE_MAX]; int len, res; - BLI_strncpy(tmp, name, FILE_MAXDIR+FILE_MAXFILE); + BLI_strncpy(tmp, name, FILE_MAX); len = strlen(tmp); if (len > 3 && ( tmp[len-1]=='\\' || tmp[len-1]=='/') ) tmp[len-1] = '\0'; res = _stat(tmp, &st); if (res == -1) return(0); #elif defined(__MINGW32__) struct _stati64 st; - char tmp[FILE_MAXDIR+FILE_MAXFILE]; + char tmp[FILE_MAX]; int len, res; - BLI_strncpy(tmp, name, FILE_MAXDIR+FILE_MAXFILE); + BLI_strncpy(tmp, name, FILE_MAX); len = strlen(tmp); if (len > 3 && ( tmp[len-1]=='\\' || tmp[len-1]=='/') ) tmp[len-1] = '\0'; res = _stati64(tmp, &st); diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index d3e989c28ae..1b5bb607386 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -47,13 +47,13 @@ #define WIN32_SKIP_HKEY_PROTECTION // need to use HKEY #include "BLI_winstuff.h" - /* FILE_MAXDIR + FILE_MAXFILE */ + /* FILE_MAX */ int BLI_getInstallationDir( char * str ) { char dir[FILE_MAXDIR]; int a; - GetModuleFileName(NULL,str,FILE_MAXDIR+FILE_MAXFILE); + GetModuleFileName(NULL,str,FILE_MAX); BLI_split_dir_part(str, dir, sizeof(dir)); /* shouldn't be relative */ a = strlen(dir); if(dir[a-1] == '\\') dir[a-1]=0; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 4e6d05a2a48..569e3368225 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -502,7 +502,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *filepat { Main *m; Library *lib; - char name1[FILE_MAXDIR+FILE_MAXFILE]; + char name1[FILE_MAX]; BLI_strncpy(name1, filepath, sizeof(name1)); cleanup_path(relabase, name1); diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index 358a7659d51..c7a53555415 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -59,7 +59,7 @@ typedef struct FileData { gzFile gzfiledes; // now only in use for library appending - char relabase[FILE_MAXDIR+FILE_MAXFILE]; + char relabase[FILE_MAX]; // variables needed for reading from stream char headerdone; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 78efc686da4..0835397f661 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2700,7 +2700,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil /* return: success(0), failure(1) */ static int do_history(const char *name, ReportList *reports) { - char tempname1[FILE_MAXDIR+FILE_MAXFILE], tempname2[FILE_MAXDIR+FILE_MAXFILE]; + char tempname1[FILE_MAX], tempname2[FILE_MAX]; int hisnr= U.versions; if(U.versions==0) return 0; @@ -2734,8 +2734,8 @@ static int do_history(const char *name, ReportList *reports) /* return: success (1) */ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportList *reports, int *thumb) { - char userfilename[FILE_MAXDIR+FILE_MAXFILE]; - char tempname[FILE_MAXDIR+FILE_MAXFILE+1]; + char userfilename[FILE_MAX]; + char tempname[FILE_MAX+1]; int file, err, write_user_block; /* open temporary file, so we preserve the original in case we crash */ @@ -2749,8 +2749,8 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL /* remapping of relative paths to new file location */ if(write_flags & G_FILE_RELATIVE_REMAP) { - char dir1[FILE_MAXDIR+FILE_MAXFILE]; - char dir2[FILE_MAXDIR+FILE_MAXFILE]; + char dir1[FILE_MAX]; + char dir2[FILE_MAX]; BLI_split_dir_part(filepath, dir1, sizeof(dir1)); BLI_split_dir_part(mainvar->name, dir2, sizeof(dir2)); @@ -2801,7 +2801,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL if(write_flags & G_FILE_COMPRESS) { /* compressed files have the same ending as regular files... only from 2.4!!! */ - char gzname[FILE_MAXDIR+FILE_MAXFILE+4]; + char gzname[FILE_MAX+4]; int ret; /* first write compressed to separate @.gz */ diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index def6cd61370..d40831f9e87 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -107,7 +107,7 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick if (totpoints == 1) { /* draw point */ glBegin(GL_POINTS); - glVertex2f(points->x, points->y); + glVertex2iv(&points->x); glEnd(); } else if (sflag & GP_STROKE_ERASER) { @@ -132,18 +132,15 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick glBegin(GL_LINE_STRIP); /* need to roll-back one point to ensure that there are no gaps in the stroke */ - if (i != 0) { - pt--; - glVertex2f(pt->x, pt->y); - pt++; - } + if (i != 0) glVertex2iv(&(pt - 1)->x); + /* now the point we want... */ - glVertex2f(pt->x, pt->y); + glVertex2iv(&pt->x); oldpressure = pt->pressure; } else - glVertex2f(pt->x, pt->y); + glVertex2iv(&pt->x); } glEnd(); @@ -162,7 +159,7 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short dfl /* draw point */ if (sflag & GP_STROKE_3DSPACE) { glBegin(GL_POINTS); - glVertex3f(points->x, points->y, points->z); + glVertex3fv(&points->x); glEnd(); } else { @@ -228,18 +225,16 @@ static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thicknes glBegin(GL_LINE_STRIP); /* need to roll-back one point to ensure that there are no gaps in the stroke */ - if (i != 0) { - pt--; - glVertex3f(pt->x, pt->y, pt->z); - pt++; - } + if (i != 0) glVertex3fv(&(pt - 1)->x); + /* now the point we want... */ - glVertex3f(pt->x, pt->y, pt->z); + glVertex3fv(&pt->x); oldpressure = pt->pressure; } - else - glVertex3f(pt->x, pt->y, pt->z); + else { + glVertex3fv(&pt->x); + } } glEnd(); @@ -247,7 +242,7 @@ static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thicknes if (debug) { glBegin(GL_POINTS); for (i=0, pt=points; i < totpoints && pt; i++, pt++) - glVertex3f(pt->x, pt->y, pt->z); + glVertex3fv(&pt->x); glEnd(); } } @@ -461,7 +456,7 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness_s glBegin(GL_POINTS); for (i=0, pt=points; i < totpoints && pt; i++, pt++) { if (sflag & GP_STROKE_2DSPACE) { - glVertex2f(pt->x, pt->y); + glVertex2fv(&pt->x); } else if (sflag & GP_STROKE_2DIMAGE) { const float x= (float)((pt->x * winx) + offsx); diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index f09797bf6f1..6c93727bf55 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -331,8 +331,7 @@ static short gp_stroke_addpoint (tGPsdata *p, const int mval[2], float pressure) pt= (tGPspoint *)(gpd->sbuffer); /* store settings */ - pt->x= mval[0]; - pt->y= mval[1]; + copy_v2_v2_int(&pt->x, mval); pt->pressure= pressure; /* increment buffer size */ @@ -345,8 +344,7 @@ static short gp_stroke_addpoint (tGPsdata *p, const int mval[2], float pressure) pt= ((tGPspoint *)(gpd->sbuffer) + 1); /* store settings */ - pt->x= mval[0]; - pt->y= mval[1]; + copy_v2_v2_int(&pt->x, mval); pt->pressure= pressure; /* if this is just the second point we've added, increment the buffer size @@ -369,8 +367,7 @@ static short gp_stroke_addpoint (tGPsdata *p, const int mval[2], float pressure) pt= ((tGPspoint *)(gpd->sbuffer) + gpd->sbuffer_size); /* store settings */ - pt->x= mval[0]; - pt->y= mval[1]; + copy_v2_v2_int(&pt->x, mval); pt->pressure= pressure; /* increment counters */ @@ -387,8 +384,7 @@ static short gp_stroke_addpoint (tGPsdata *p, const int mval[2], float pressure) pt= (tGPspoint *)(gpd->sbuffer); /* store settings */ - pt->x= mval[0]; - pt->y= mval[1]; + copy_v2_v2_int(&pt->x, mval); pt->pressure= pressure; /* if there's stroke for this poly line session add (or replace last) point @@ -475,9 +471,8 @@ static void gp_stroke_smooth (tGPsdata *p) /* second pass: apply smoothed coordinates */ for (i=0, spc=smoothArray; i < gpd->sbuffer_size; i++, spc++) { tGPspoint *pc= (((tGPspoint *)gpd->sbuffer) + i); - - pc->x = spc->x; - pc->y = spc->y; + + copy_v2_v2_int(&pc->x, &spc->x); } /* free temp array */ @@ -653,7 +648,7 @@ static void gp_stroke_newfrombuffer (tGPsdata *p) depth_arr= MEM_mallocN(sizeof(float) * gpd->sbuffer_size, "depth_points"); for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size; i++, ptc++, pt++) { - mval[0]= ptc->x; mval[1]= ptc->y; + copy_v2_v2_int(mval, &ptc->x); if ((ED_view3d_autodist_depth(p->ar, mval, depth_margin, depth_arr+i) == 0) && (i && (ED_view3d_autodist_depth_seg(p->ar, mval, mval_prev, depth_margin + 1, depth_arr+i) == 0)) diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 86961cd84dc..a10de9a8a42 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1027,7 +1027,7 @@ void uiDrawBlock(const bContext *C, uiBlock *block) glMatrixMode(GL_MODELVIEW); glPopMatrix(); - if(multisample_enabled) + if(multisample_enabled) glEnable(GL_MULTISAMPLE_ARB); ui_draw_links(block); @@ -1037,25 +1037,25 @@ void uiDrawBlock(const bContext *C, uiBlock *block) static void ui_is_but_sel(uiBut *but, double *value) { - short push=0, true=1; + short is_push=0, is_true=1; - if(ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) true= 0; + if(ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) is_true= 0; if( but->bit ) { int lvalue; UI_GET_BUT_VALUE_INIT(but, *value) lvalue= (int)*value; - if( BTST(lvalue, (but->bitnr)) ) push= true; - else push= !true; + if( BTST(lvalue, (but->bitnr)) ) is_push= is_true; + else is_push= !is_true; } else { switch(but->type) { case BUT: - push= 2; + is_push= 2; break; case HOTKEYEVT: case KEYEVT: - push= 2; + is_push= 2; break; case TOGBUT: case TOG: @@ -1065,36 +1065,36 @@ static void ui_is_but_sel(uiBut *but, double *value) case ICONTOG: case OPTION: UI_GET_BUT_VALUE_INIT(but, *value) - if(*value != (double)but->hardmin) push= 1; + if(*value != (double)but->hardmin) is_push= 1; break; case ICONTOGN: case TOGN: case OPTIONN: UI_GET_BUT_VALUE_INIT(but, *value) - if(*value==0.0) push= 1; + if(*value==0.0) is_push= 1; break; case ROW: case LISTROW: UI_GET_BUT_VALUE_INIT(but, *value) /* support for rna enum buts */ if(but->rnaprop && (RNA_property_flag(but->rnaprop) & PROP_ENUM_FLAG)) { - if((int)*value & (int)but->hardmax) push= 1; + if((int)*value & (int)but->hardmax) is_push= 1; } else { - if(*value == (double)but->hardmax) push= 1; + if(*value == (double)but->hardmax) is_push= 1; } break; case COL: - push= 2; + is_push= 2; break; default: - push= 2; + is_push= 2; break; } } - if(push==2); - else if(push==1) but->flag |= UI_SELECT; + if(is_push==2); + else if(is_push==1) but->flag |= UI_SELECT; else but->flag &= ~UI_SELECT; } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index a0b0d34ab44..cd3243bb9dc 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -6097,7 +6097,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle /* closing sublevels of pulldowns */ case LEFTARROWKEY: if(event->val==KM_PRESS && (block->flag & UI_BLOCK_LOOP)) - if(BLI_countlist(&block->saferct) > 0) + if(block->saferct.first) menu->menuretval= UI_RETURN_OUT; retval= WM_UI_HANDLER_BREAK; diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 1b7308d328e..a7d8c688f43 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -509,7 +509,7 @@ static void init_internal_icons(void) bTheme *btheme= UI_GetTheme(); ImBuf *bbuf= NULL; int x, y, icontype; - char iconfilestr[FILE_MAXDIR+FILE_MAXFILE]; + char iconfilestr[FILE_MAX]; if ((btheme!=NULL) && btheme->tui.iconfile[0]) { char *icondir= BLI_get_folder(BLENDER_DATAFILES, "icons"); diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 9dd4503414a..cc60f4a52fd 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -637,7 +637,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF FluidsimSettings *domainSettings= fluidmd->fss; FILE *fileCfg; int dirExist = 0; - char newSurfdataPath[FILE_MAXDIR+FILE_MAXFILE]; // modified output settings + char newSurfdataPath[FILE_MAX]; // modified output settings const char *suffixConfig = FLUID_SUFFIX_CONFIG; int outStringsChanged = 0; @@ -667,15 +667,15 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF } if(targetDir[0] == '\0' || (!dirExist)) { - char blendDir[FILE_MAXDIR+FILE_MAXFILE]; - char blendFile[FILE_MAXDIR+FILE_MAXFILE]; + char blendDir[FILE_MAX]; + char blendFile[FILE_MAX]; // invalid dir, reset to current/previous - BLI_strncpy(blendDir, G.main->name, FILE_MAXDIR+FILE_MAXFILE); + BLI_strncpy(blendDir, G.main->name, FILE_MAX); BLI_splitdirstring(blendDir, blendFile); - BLI_replace_extension(blendFile, FILE_MAXDIR+FILE_MAXFILE, ""); /* strip .blend */ + BLI_replace_extension(blendFile, FILE_MAX, ""); /* strip .blend */ - BLI_snprintf(newSurfdataPath, FILE_MAXDIR+FILE_MAXFILE ,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name); + BLI_snprintf(newSurfdataPath, FILE_MAX ,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name); BLI_snprintf(debugStrBuffer, 256, "fluidsimBake::error - warning resetting output dir to '%s'\n", newSurfdataPath); elbeemDebugOut(debugStrBuffer); @@ -685,7 +685,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF // check if modified output dir is ok #if 0 if(outStringsChanged) { - char dispmsg[FILE_MAXDIR+FILE_MAXFILE+256]; + char dispmsg[FILE_MAX+256]; int selection=0; BLI_strncpy(dispmsg,"Output settings set to: '", sizeof(dispmsg)); strcat(dispmsg, newSurfdataPath); @@ -810,9 +810,9 @@ static void fluidbake_free_data(FluidAnimChannels *channels, ListBase *fobjects, /* copied from rna_fluidsim.c: fluidsim_find_lastframe() */ static void fluidsim_delete_until_lastframe(FluidsimSettings *fss, const char *relbase) { - char targetDir[FILE_MAXFILE+FILE_MAXDIR], targetFile[FILE_MAXFILE+FILE_MAXDIR]; - char targetDirVel[FILE_MAXFILE+FILE_MAXDIR], targetFileVel[FILE_MAXFILE+FILE_MAXDIR]; - char previewDir[FILE_MAXFILE+FILE_MAXDIR], previewFile[FILE_MAXFILE+FILE_MAXDIR]; + char targetDir[FILE_MAX], targetFile[FILE_MAX]; + char targetDirVel[FILE_MAX], targetFileVel[FILE_MAX]; + char previewDir[FILE_MAX], previewFile[FILE_MAX]; int curFrame = 1, exists = 0; BLI_join_dirfile(targetDir, sizeof(targetDir), fss->surfdataPath, OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME); @@ -859,8 +859,8 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor const char *suffixConfig = FLUID_SUFFIX_CONFIG; const char *suffixSurface = FLUID_SUFFIX_SURFACE; - char targetDir[FILE_MAXDIR+FILE_MAXFILE]; // store & modify output settings - char targetFile[FILE_MAXDIR+FILE_MAXFILE]; // temp. store filename from targetDir for access + char targetDir[FILE_MAX]; // store & modify output settings + char targetFile[FILE_MAX]; // temp. store filename from targetDir for access int outStringsChanged = 0; // modified? copy back before baking float domainMat[4][4]; diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index f826d0ec41a..0cecfa05b49 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -321,7 +321,9 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op)) for(pid=pidlist.first; pid; pid=pid->next) { if(pid->cache == cache) { - *(pid->cache_ptr) = BKE_ptcache_add(pid->ptcaches); + PointCache *cache = BKE_ptcache_add(pid->ptcaches); + cache->step = pid->default_step; + *(pid->cache_ptr) = cache; break; } } diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index a68286b8e88..3a2d9f137d7 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -392,7 +392,7 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op) Scene *scene= oglrender->scene; ImBuf *ibuf; void *lock; - char name[FILE_MAXDIR+FILE_MAXFILE]; + char name[FILE_MAX]; int ok= 0; const short view_context= (oglrender->v3d != NULL); Object *camera= NULL; diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 48970dffce0..7d0ec866456 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -160,7 +160,7 @@ static int screenshot_exec(bContext *C, wmOperator *op) /* BKE_add_image_extension() checks for if extension was already set */ if(scene->r.scemode & R_EXTENSION) - if(strlen(path)r.im_format.imtype); ibuf= IMB_allocImBuf(scd->dumpsx, scd->dumpsy, 24, 0); @@ -295,7 +295,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float } else { ImBuf *ibuf= IMB_allocImBuf(sj->dumpsx, sj->dumpsy, rd.im_format.planes, 0); - char name[FILE_MAXDIR+FILE_MAXFILE]; + char name[FILE_MAX]; int ok; BKE_makepicstring(name, rd.pic, sj->bmain->name, cfra, rd.im_format.imtype, rd.scemode & R_EXTENSION, TRUE); diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 4867552cc52..c713317aa7e 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -192,7 +192,7 @@ static int path_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(eve static void path_drop_copy(wmDrag *drag, wmDropBox *drop) { - char pathname[FILE_MAXDIR+FILE_MAXFILE+2]; + char pathname[FILE_MAX+2]; BLI_snprintf(pathname, sizeof(pathname), "\"%s\"", drag->path); RNA_string_set(drop->ptr, "text", pathname); } diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index deed7ad2a3a..288ff76d9ff 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -852,7 +852,7 @@ static void filelist_read_library(struct FileList* filelist) file = filelist->filelist; for(num=0; numnumfiles; num++, file++) { if(BLO_has_bfile_extension(file->relname)) { - char name[FILE_MAXDIR+FILE_MAXFILE]; + char name[FILE_MAX]; BLI_strncpy(name, filelist->dir, sizeof(name)); strcat(name, file->relname); @@ -988,7 +988,7 @@ void filelist_from_library(struct FileList* filelist) LinkNode *l, *names, *previews; struct ImBuf* ima; int ok, i, nprevs, nnames, idcode; - char filename[FILE_MAXDIR+FILE_MAXFILE]; + char filename[FILE_MAX]; char dir[FILE_MAX], group[GROUP_MAX]; /* name test */ @@ -1179,7 +1179,7 @@ void filelist_from_main(struct FileList *filelist) if(id->lib==NULL) files->relname= BLI_strdup(id->name+2); else { - files->relname= MEM_mallocN(FILE_MAXDIR+FILE_MAXFILE+32, "filename for lib"); + files->relname= MEM_mallocN(FILE_MAX+32, "filename for lib"); sprintf(files->relname, "%s | %s", id->lib->name, id->name+2); } files->type |= S_IFREG; diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 6b3477d1fe5..9a952d22274 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -326,13 +326,13 @@ void fsmenu_read_system(struct FSMenu* fsmenu) for (i=1; err!=nsvErr; i++) { FSRef dir; - unsigned char path[FILE_MAXDIR+FILE_MAXFILE]; + unsigned char path[FILE_MAX]; err = FSGetVolumeInfo(kFSInvalidVolumeRefNum, i, NULL, kFSVolInfoNone, NULL, NULL, &dir); if (err != noErr) continue; - FSRefMakePath(&dir, path, FILE_MAXDIR+FILE_MAXFILE); + FSRefMakePath(&dir, path, FILE_MAX); if (strcmp((char*)path, "/home") && strcmp((char*)path, "/net")) { /* /net and /home are meaningless on OSX, home folders are stored in /Users */ fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, 1, 0); @@ -414,7 +414,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) FSRef dir; FSVolumeRefNum volRefNum; struct GetVolParmsInfoBuffer volParmsBuffer; - unsigned char path[FILE_MAXDIR+FILE_MAXFILE]; + unsigned char path[FILE_MAX]; err = FSGetVolumeInfo(kFSInvalidVolumeRefNum, i, &volRefNum, kFSVolInfoNone, NULL, NULL, &dir); if (err != noErr) @@ -425,7 +425,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) continue; - FSRefMakePath(&dir, path, FILE_MAXDIR+FILE_MAXFILE); + FSRefMakePath(&dir, path, FILE_MAX); fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, 1, 0); } diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index c99a0be15dc..6027a272270 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -370,6 +370,7 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname) NULL, 0.0, 0.0, 0.0, 0.0, "Add node to input"); argN = MEM_dupallocN(arg); + argN->type = NODE_GROUP; argN->ngroup = ngroup; argN->output = i; uiButSetNFunc(but, ui_node_link, argN, NULL); diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 27ad2c4fd6d..f4e46d0255d 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -297,8 +297,6 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto if(base==NULL) base= object_in_scene((Object *)tselem->id, scene); if(base) { - SpaceOops *soops= CTX_wm_space_outliner(C); - // check also library later if(scene->obedit==base->object) ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR|EM_DO_UNDO); @@ -306,15 +304,7 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto ED_base_object_free_and_unlink(CTX_data_main(C), scene, base); te->directdata= NULL; tselem->id= NULL; - - /* XXX: tree management normally happens from draw_outliner(), but when - you're clicking to fast on Delete object from context menu in - outliner several mouse events can be handled in one cycle without - handling notifiers/redraw which leads to deleting the same object twice. - cleanup tree here to prevent such cases. */ - outliner_cleanup_tree(soops); } - } static void id_local_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) @@ -579,6 +569,14 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op) } else if(event==4) { outliner_do_object_operation(C, scene, soops, &soops->tree, object_delete_cb); + + /* XXX: tree management normally happens from draw_outliner(), but when + you're clicking to fast on Delete object from context menu in + outliner several mouse events can be handled in one cycle without + handling notifiers/redraw which leads to deleting the same object twice. + cleanup tree here to prevent such cases. */ + outliner_cleanup_tree(soops); + DAG_scene_sort(bmain, scene); str= "Delete Objects"; WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index ddfa2fd915f..2b59a02deae 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -512,7 +512,7 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq) static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float y1, float y2, const unsigned char background_col[3]) { rctf rect; - char str[32 + FILE_MAXDIR+FILE_MAXFILE]; + char str[32 + FILE_MAX]; const char *name= seq->name+2; char col[4]; diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index e36cdd32ab8..16ee32d10a2 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -449,9 +449,9 @@ static void txt_write_file(Text *text, ReportList *reports) FILE *fp; TextLine *tmp; struct stat st; - char filepath[FILE_MAXDIR+FILE_MAXFILE]; + char filepath[FILE_MAX]; - BLI_strncpy(filepath, text->name, FILE_MAXDIR+FILE_MAXFILE); + BLI_strncpy(filepath, text->name, FILE_MAX); BLI_path_abs(filepath, G.main->name); fp= fopen(filepath, "w"); @@ -3053,12 +3053,12 @@ int text_file_modified(Text *text) { struct stat st; int result; - char file[FILE_MAXDIR+FILE_MAXFILE]; + char file[FILE_MAX]; if(!text || !text->name) return 0; - BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE); + BLI_strncpy(file, text->name, FILE_MAX); BLI_path_abs(file, G.main->name); if(!BLI_exists(file)) @@ -3082,11 +3082,11 @@ static void text_ignore_modified(Text *text) { struct stat st; int result; - char file[FILE_MAXDIR+FILE_MAXFILE]; + char file[FILE_MAX]; if(!text || !text->name) return; - BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE); + BLI_strncpy(file, text->name, FILE_MAX); BLI_path_abs(file, G.main->name); if(!BLI_exists(file)) return; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 807822928b6..1ed4edd5fcb 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -115,6 +115,12 @@ ((ELEM(vd->drawtype, OB_TEXTURE, OB_MATERIAL) && dt>OB_SOLID) || \ (vd->drawtype==OB_SOLID && vd->flag2 & V3D_SOLID_TEX)) +typedef enum eWireDrawMode { + OBDRAW_WIRE_OFF= 0, + OBDRAW_WIRE_ON= 1, + OBDRAW_WIRE_ON_DEPTH= 2 +} eWireDrawMode; + static void draw_bounding_volume(Scene *scene, Object *ob, char type); static void drawcube_size(float size); @@ -1096,7 +1102,12 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, /* cone can't be drawn for duplicated lamps, because duplilist would be freed to */ /* the moment of view3d_draw_transp() call */ const short is_view= (rv3d->persp==RV3D_CAMOB && v3d->camera == base->object); - const short drawcone= (dt>OB_WIRE && !(G.f & G_PICKSEL) && (la->type == LA_SPOT) && (la->mode & LA_SHOW_CONE) && !(base->flag & OB_FROMDUPLI) && !is_view); + const short drawcone= ((dt > OB_WIRE) && + !(G.f & G_PICKSEL) && + (la->type == LA_SPOT) && + (la->mode & LA_SHOW_CONE) && + !(base->flag & OB_FROMDUPLI) && + !is_view); if(drawcone && !v3d->transp) { /* in this case we need to draw delayed */ @@ -1571,7 +1582,7 @@ static void draw_viewport_reconstruction(Scene *scene, Base *base, View3D *v3d, glBegin(GL_LINE_STRIP); for(a= 0; acamnr; a++, camera++) { - glVertex3f(camera->mat[3][0], camera->mat[3][1], camera->mat[3][2]); + glVertex3fv(camera->mat[3]); } glEnd(); @@ -1809,7 +1820,7 @@ static void drawlattice__point(Lattice *lt, DispList *dl, int u, int v, int w, i float col[3]; MDeformWeight *mdw= defvert_find_index (lt->dvert+index, use_wcol-1); - weight_to_rgb(mdw?mdw->weight:0.0f, col, col+1, col+2); + weight_to_rgb(col, mdw?mdw->weight:0.0f); glColor3fv(col); } @@ -2995,7 +3006,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D Mesh *me = ob->data; Material *ma= give_current_material(ob, 1); const short hasHaloMat = (ma && (ma->material_type == MA_TYPE_HALO)); - int draw_wire = 0; + eWireDrawMode draw_wire= OBDRAW_WIRE_OFF; int /* totvert,*/ totedge, totface; DerivedMesh *dm= mesh_get_derived_final(scene, ob, scene->customdata_mask); ModifierData *md = NULL; @@ -3018,9 +3029,13 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D } } } - - if (ob->dtx&OB_DRAWWIRE) { - draw_wire = 2; /* draw wire after solid using zoffset and depth buffer adjusment */ + + /* Unwanted combination */ + if (draw_flags & DRAW_FACE_SELECT) { + draw_wire= OBDRAW_WIRE_OFF; + } + else if (ob->dtx & OB_DRAWWIRE) { + draw_wire= OBDRAW_WIRE_ON_DEPTH; /* draw wire after solid using zoffset and depth buffer adjusment */ } /* totvert = dm->getNumVerts(dm); */ /*UNUSED*/ @@ -3030,9 +3045,6 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D /* vertexpaint, faceselect wants this, but it doesnt work for shaded? */ glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); - // Unwanted combination. - if (draw_flags & DRAW_FACE_SELECT) draw_wire = 0; - if(dt==OB_BOUNDBOX) { if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0) draw_bounding_volume(scene, ob, ob->boundtype); @@ -3043,12 +3055,17 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D glPointSize(1.0); } else if(dt==OB_WIRE || totface==0) { - draw_wire = 1; /* draw wire only, no depth buffer stuff */ + draw_wire= OBDRAW_WIRE_ON; /* draw wire only, no depth buffer stuff */ } - else if( (draw_flags & DRAW_FACE_SELECT || (ob==OBACT && ob->mode & OB_MODE_TEXTURE_PAINT)) || - CHECK_OB_DRAWTEXTURE(v3d, dt)) + else if ( (draw_flags & DRAW_FACE_SELECT || (ob==OBACT && ob->mode & OB_MODE_TEXTURE_PAINT)) || + CHECK_OB_DRAWTEXTURE(v3d, dt)) { - if ((v3d->flag&V3D_SELECT_OUTLINE) && ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && (base->flag&SELECT) && !(G.f&G_PICKSEL || (draw_flags & DRAW_FACE_SELECT)) && !draw_wire) { + if ( (v3d->flag & V3D_SELECT_OUTLINE) && + ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && + (base->flag & SELECT) && + !(G.f & G_PICKSEL || (draw_flags & DRAW_FACE_SELECT)) && + (draw_wire == OBDRAW_WIRE_OFF)) + { draw_mesh_object_outline(v3d, ob, dm); } @@ -3100,7 +3117,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D GPU_disable_material(); /* since we already draw wire as wp guide, dont draw over the top */ - draw_wire= 0; + draw_wire= OBDRAW_WIRE_OFF; } else if (draw_flags & DRAW_DYNAMIC_PAINT_PREVIEW) { /* for object selection draws no shade */ @@ -3109,8 +3126,14 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D } else { /* draw outline */ - if((v3d->flag&V3D_SELECT_OUTLINE) && ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && (base->flag&SELECT) && !draw_wire && !ob->sculpt) + if ( (v3d->flag & V3D_SELECT_OUTLINE) && + ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && + (base->flag & SELECT) && + (draw_wire == OBDRAW_WIRE_OFF) && + (ob->sculpt == NULL)) + { draw_mesh_object_outline(v3d, ob, dm); + } /* materials arent compatible with vertex colors */ GPU_end_object_materials(); @@ -3137,8 +3160,14 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D else { Paint *p; - if((v3d->flag&V3D_SELECT_OUTLINE) && ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && (base->flag&SELECT) && !draw_wire && !ob->sculpt) + if ( (v3d->flag & V3D_SELECT_OUTLINE) && + ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && + (base->flag & SELECT) && + (draw_wire == OBDRAW_WIRE_OFF) && + (ob->sculpt == NULL)) + { draw_mesh_object_outline(v3d, ob, dm); + } glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED ); @@ -3232,7 +3261,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D } } } - if (draw_wire) { + if (draw_wire != OBDRAW_WIRE_OFF) { /* When using wireframe object traw in particle edit mode * the mesh gets in the way of seeing the particles, fade the wire color @@ -3255,7 +3284,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D * if draw wire is 1 then just drawing wire, no need for depth buffer stuff, * otherwise this wire is to overlay solid mode faces so do some depth buffer tricks. */ - if (dt!=OB_WIRE && draw_wire==2) { + if (dt!=OB_WIRE && (draw_wire == OBDRAW_WIRE_ON_DEPTH)) { bglPolygonOffset(rv3d->dist, 1.0); glDepthMask(0); // disable write in zbuffer, selected edge wires show better } @@ -3263,7 +3292,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_SOLID)==0) dm->drawEdges(dm, (dt==OB_WIRE || totface==0), me->drawflag & ME_ALLEDGES); - if (dt!=OB_WIRE && draw_wire==2) { + if (dt!=OB_WIRE && (draw_wire == OBDRAW_WIRE_ON_DEPTH)) { glDepthMask(1); bglPolygonOffset(rv3d->dist, 0.0); } @@ -3318,15 +3347,11 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D if(dt>OB_WIRE) { glsl = draw_glsl_material(scene, ob, v3d, dt); - check_alpha = check_material_alpha(base, glsl); - GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, - (check_alpha)? &do_alpha_pass: NULL); + GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL); } - // transp in editmode makes the fancy draw over go bad - if (!do_alpha_pass) - draw_em_fancy(scene, v3d, rv3d, ob, em, cageDM, finalDM, dt); + draw_em_fancy(scene, v3d, rv3d, ob, em, cageDM, finalDM, dt); GPU_end_object_materials(); @@ -3779,19 +3804,15 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix float vec[3], vec2[3]; float *vd = NULL; float *cd = NULL; - float ma_r=0.0f; - float ma_g=0.0f; - float ma_b=0.0f; + float ma_col[3]= {0.0f, 0.0f, 0.0f}; /* null only for PART_DRAW_CIRC */ if(pdd) { vd = pdd->vd; cd = pdd->cd; - if(pdd->ma_r) { - ma_r = *pdd->ma_r; - ma_g = *pdd->ma_g; - ma_b = *pdd->ma_b; + if(pdd->ma_col) { + copy_v3_v3(ma_col, pdd->ma_col); } } @@ -3802,9 +3823,7 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix copy_v3_v3(vd,state->co); pdd->vd+=3; } if(cd) { - cd[0]=ma_r; - cd[1]=ma_g; - cd[2]=ma_b; + copy_v3_v3(cd, pdd->ma_col); pdd->cd+=3; } break; @@ -3830,9 +3849,9 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix } else { if(cd) { - cd[0]=cd[3]=cd[6]=cd[9]=cd[12]=cd[15]=ma_r; - cd[1]=cd[4]=cd[7]=cd[10]=cd[13]=cd[16]=ma_g; - cd[2]=cd[5]=cd[8]=cd[11]=cd[14]=cd[17]=ma_b; + cd[0]=cd[3]=cd[6]=cd[ 9]=cd[12]=cd[15]= ma_col[0]; + cd[1]=cd[4]=cd[7]=cd[10]=cd[13]=cd[16]= ma_col[1]; + cd[2]=cd[5]=cd[8]=cd[11]=cd[14]=cd[17]= ma_col[2]; pdd->cd+=18; } sub_v3_v3v3(vec2, state->co, vec); @@ -3877,9 +3896,9 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix madd_v3_v3v3fl(pdd->vd, state->co, vec, -draw_line[0]); pdd->vd+=3; madd_v3_v3v3fl(pdd->vd, state->co, vec, draw_line[1]); pdd->vd+=3; if(cd) { - cd[0]=cd[3]=ma_r; - cd[1]=cd[4]=ma_g; - cd[2]=cd[5]=ma_b; + cd[0]=cd[3]= ma_col[0]; + cd[1]=cd[4]= ma_col[1]; + cd[2]=cd[5]= ma_col[2]; pdd->cd+=6; } break; @@ -3893,9 +3912,9 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix { float xvec[3], yvec[3], zvec[3], bb_center[3]; if(cd) { - cd[0]=cd[3]=cd[6]=cd[9]=ma_r; - cd[1]=cd[4]=cd[7]=cd[10]=ma_g; - cd[2]=cd[5]=cd[8]=cd[11]=ma_b; + cd[0]=cd[3]=cd[6]=cd[ 9]= ma_col[0]; + cd[1]=cd[4]=cd[7]=cd[10]= ma_col[1]; + cd[2]=cd[5]=cd[8]=cd[11]= ma_col[2]; pdd->cd+=12; } @@ -3950,7 +3969,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv float timestep, pixsize=1.0, pa_size, r_tilt, r_length; float pa_time, pa_birthtime, pa_dietime, pa_health, intensity; float cfra; - float ma_r=0.0f, ma_g=0.0f, ma_b=0.0f; + float ma_col[3]= {0.0f, 0.0f, 0.0f}; int a, totpart, totpoint=0, totve=0, drawn, draw_as, totchild=0; int select=ob->flag&SELECT, create_cdata=0, need_v=0; GLint polygonmode[2]; @@ -4014,10 +4033,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if((ma) && (part->draw_col == PART_DRAW_COL_MAT)) { rgb_float_to_byte(&(ma->r), tcol); - - ma_r = ma->r; - ma_g = ma->g; - ma_b = ma->b; + copy_v3_v3(ma_col, &ma->r); } glColor3ubv(tcol); @@ -4183,9 +4199,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv } if(pdd) { - pdd->ma_r = &ma_r; - pdd->ma_g = &ma_g; - pdd->ma_b = &ma_b; + pdd->ma_col= ma_col; } psys->lattice= psys_get_lattice(&sim); @@ -4227,7 +4241,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv intensity= 1.0f; /* should never happen */ } CLAMP(intensity, 0.f, 1.f); - weight_to_rgb(intensity, &ma_r, &ma_g, &ma_b); + weight_to_rgb(ma_col, intensity); } } else{ @@ -4488,7 +4502,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv } /* restore from select */ - glColor3f(ma_r,ma_g,ma_b); + glColor3fv(ma_col); glPointSize(part->draw_size ? part->draw_size : 2.0); glLineWidth(1.0); @@ -4553,7 +4567,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(pdd) { /* drop references to stack memory */ - pdd->ma_r= pdd->ma_g= pdd->ma_b= NULL; + pdd->ma_col= NULL; } if( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) { diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 7dae02aba39..5dfb9cfb5b6 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1329,7 +1329,7 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d) v3d->zbuf= FALSE; glDisable(GL_DEPTH_TEST); glEnable(GL_DITHER); - if(multisample_enabled) + if(multisample_enabled) glEnable(GL_MULTISAMPLE_ARB); if(rv3d->rflag & RV3D_CLIPPING) diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 8b43973669e..169135478f6 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -164,7 +164,7 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha PointerRNA props_ptr; uiPopupMenu *pup; uiLayout *layout; - char line[FILE_MAXDIR + FILE_MAXFILE + 100]; + char line[FILE_MAX + 100]; pup= uiPupMenuBegin(C, "Unpack file", ICON_NONE); layout= uiPupMenuLayout(pup); diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 04eb940393f..539c7cada7a 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -263,7 +263,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe else areadiff = 1.0f-(area/uvarea); - weight_to_rgb(areadiff, col, col+1, col+2); + weight_to_rgb(col, areadiff); glColor3fv(col); glBegin(GL_POLYGON); @@ -343,19 +343,19 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe * 1.0-powf((1.0-a), 2) */ a = fabsf(uvang1-ang1)/(float)M_PI; - weight_to_rgb(1.0f-powf((1.0f-a), 2.0f), col, col+1, col+2); + weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f)); glColor3fv(col); glVertex2fv(tf->uv[0]); a = fabsf(uvang2-ang2)/(float)M_PI; - weight_to_rgb(1.0f-powf((1.0f-a), 2.0f), col, col+1, col+2); + weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f)); glColor3fv(col); glVertex2fv(tf->uv[1]); a = fabsf(uvang3-ang3)/(float)M_PI; - weight_to_rgb(1.0f-powf((1.0f-a), 2.0f), col, col+1, col+2); + weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f)); glColor3fv(col); glVertex2fv(tf->uv[2]); a = fabsf(uvang4-ang4)/(float)M_PI; - weight_to_rgb(1.0f-powf((1.0f-a), 2.0f), col, col+1, col+2); + weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f)); glColor3fv(col); glVertex2fv(tf->uv[3]); @@ -398,15 +398,15 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe glBegin(GL_TRIANGLES); a = fabsf(uvang1-ang1)/(float)M_PI; - weight_to_rgb(1.0f-powf((1.0f-a), 2.0f), col, col+1, col+2); + weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f)); glColor3fv(col); glVertex2fv(tf->uv[0]); a = fabsf(uvang2-ang2)/(float)M_PI; - weight_to_rgb(1.0f-powf((1.0f-a), 2.0f), col, col+1, col+2); + weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f)); glColor3fv(col); glVertex2fv(tf->uv[1]); a = fabsf(uvang3-ang3)/(float)M_PI; - weight_to_rgb(1.0f-powf((1.0f-a), 2.0f), col, col+1, col+2); + weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f)); glColor3fv(col); glVertex2fv(tf->uv[2]); } diff --git a/source/blender/imbuf/intern/IMB_indexer.h b/source/blender/imbuf/intern/IMB_indexer.h index 9ce587aa983..62608cbbd79 100644 --- a/source/blender/imbuf/intern/IMB_indexer.h +++ b/source/blender/imbuf/intern/IMB_indexer.h @@ -72,8 +72,8 @@ struct anim_index_builder; typedef struct anim_index_builder { FILE * fp; - char name[FILE_MAXDIR + FILE_MAXFILE]; - char temp_name[FILE_MAXDIR + FILE_MAXFILE]; + char name[FILE_MAX]; + char temp_name[FILE_MAX]; void * private_data; diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 9993df61089..4088cf861e7 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -457,7 +457,7 @@ static struct proxy_output_ctx * alloc_proxy_output_ffmpeg( struct proxy_output_ctx * rv = MEM_callocN( sizeof(struct proxy_output_ctx), "alloc_proxy_output"); - char fname[FILE_MAXDIR+FILE_MAXFILE]; + char fname[FILE_MAX]; // JPEG requires this width = round_up(width, 8); @@ -626,8 +626,8 @@ static void free_proxy_output_ffmpeg(struct proxy_output_ctx * ctx, int rollback) { int i; - char fname[FILE_MAXDIR+FILE_MAXFILE]; - char fname_tmp[FILE_MAXDIR+FILE_MAXFILE]; + char fname[FILE_MAX]; + char fname_tmp[FILE_MAX]; if (!ctx) { return; @@ -782,7 +782,7 @@ static int index_rebuild_ffmpeg(struct anim * anim, for (i = 0; i < num_indexers; i++) { if (tcs_in_use & tc_types[i]) { - char fname[FILE_MAXDIR+FILE_MAXFILE]; + char fname[FILE_MAX]; get_tc_filename(anim, tc_types[i], fname); @@ -941,8 +941,8 @@ static void index_rebuild_fallback(struct anim * anim, int cnt = IMB_anim_get_duration(anim, IMB_TC_NONE); int i, pos; AviMovie * proxy_ctx[IMB_PROXY_MAX_SLOT]; - char fname[FILE_MAXDIR+FILE_MAXFILE]; - char fname_tmp[FILE_MAXDIR+FILE_MAXFILE]; + char fname[FILE_MAX]; + char fname_tmp[FILE_MAX]; memset(proxy_ctx, 0, sizeof(proxy_ctx)); @@ -957,7 +957,7 @@ static void index_rebuild_fallback(struct anim * anim, for (i = 0; i < IMB_PROXY_MAX_SLOT; i++) { if (proxy_sizes_in_use & proxy_sizes[i]) { - char fname[FILE_MAXDIR+FILE_MAXFILE]; + char fname[FILE_MAX]; get_proxy_filename(anim, proxy_sizes[i], fname, TRUE); BLI_make_existing_file(fname); @@ -1086,7 +1086,7 @@ void IMB_anim_set_index_dir(struct anim * anim, const char * dir) struct anim * IMB_anim_open_proxy( struct anim * anim, IMB_Proxy_Size preview_size) { - char fname[FILE_MAXDIR+FILE_MAXFILE]; + char fname[FILE_MAX]; int i = IMB_proxy_size_to_array_index(preview_size); if (anim->proxy_anim[i]) { @@ -1109,7 +1109,7 @@ struct anim * IMB_anim_open_proxy( struct anim_index * IMB_anim_open_index( struct anim * anim, IMB_Timecode_Type tc) { - char fname[FILE_MAXDIR+FILE_MAXFILE]; + char fname[FILE_MAX]; int i = IMB_timecode_to_array_index(tc); if (anim->curr_idx[i]) { diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index ebd51d1c102..64893420db4 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -148,9 +148,9 @@ static char **types, *typedata; /* at address types[a] is string a */ static short *typelens; /* at typelens[a] is de length of type a */ static short *alphalens; /* contains sizes as they are calculated on the DEC Alpha (64 bits), infact any 64bit system */ static short **structs, *structdata;/* at sp= structs[a] is the first address of a struct definition - sp[0] is type number - sp[1] is amount of elements - sp[2] sp[3] is typenr, namenr (etc) */ + sp[0] is type number + sp[1] is amount of elements + sp[2] sp[3] is typenr, namenr (etc) */ /** * Variable to control debug output of makesdna. * debugSDNA: diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index b7ac5f394b0..8e8dd559fb1 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -187,7 +187,7 @@ void RNA_def_function_ui_description(FunctionRNA *func, const char *description) /* Dynamic Enums * strings are not freed, assumed pointing to static location. */ -void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item); +void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item); void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem); void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item); void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item, int value); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 3125c2eec08..4afe0da85fa 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -849,7 +849,7 @@ static void rna_def_path(BlenderRNA *brna, StructRNA *srna) prop= RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STRETCH); - RNA_def_property_ui_text(prop, "Stretch", "Option for curve-deform: makes deformed child to stretch along entire path"); + RNA_def_property_ui_text(prop, "Stretch", "Option for curve-deform: make deformed child to stretch along entire path"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "use_deform_bounds", PROP_BOOLEAN, PROP_NONE); @@ -973,12 +973,12 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) /* strings */ prop= RNA_def_property(srna, "family", PROP_STRING, PROP_NONE); RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2); - RNA_def_property_ui_text(prop, "Object Font", "Use Blender Objects as font characters. Give font objects a common name followed by the character it represents, eg. familya, familyb etc, and turn on Verts Duplication"); + RNA_def_property_ui_text(prop, "Object Font", "Use Blender Objects as font characters (give font objects a common name followed by the character they represent, eg. familya, familyb, etc, and turn on Verts Duplication)"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "str"); - RNA_def_property_ui_text(prop, "Body Text", "contents of this text object"); + RNA_def_property_ui_text(prop, "Body Text", "Content of this text object"); RNA_def_property_string_funcs(prop, "rna_Curve_body_get", "rna_Curve_body_length", "rna_Curve_body_set"); RNA_def_property_string_maxlength(prop, 8192); /* note that originally str did not have a limit! */ RNA_def_property_update(prop, 0, "rna_Curve_update_data"); @@ -1239,7 +1239,7 @@ static void rna_def_curve(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem curve_axis_items[]= { - {0, "2D", 0, "2D", "Clamp the Z axis of of the curve"}, + {0, "2D", 0, "2D", "Clamp the Z axis of the curve"}, {CU_3D, "3D", 0, "3D", "Allow editing on the Z axis of this curve, also allows tilt and curve radius to be used"}, {0, NULL, 0, NULL, NULL}}; @@ -1324,18 +1324,18 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "resolu_ren"); RNA_def_property_range(prop, 0, SHRT_MAX); RNA_def_property_ui_range(prop, 0, 64, 1, 0); - RNA_def_property_ui_text(prop, "Render Resolution U", "Surface resolution in U direction used while rendering. Zero skips this property"); + RNA_def_property_ui_text(prop, "Render Resolution U", "Surface resolution in U direction used while rendering (zero skips this property)"); prop= RNA_def_property(srna, "render_resolution_v", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resolv_ren"); RNA_def_property_ui_range(prop, 0, 64, 1, 0); RNA_def_property_range(prop, 0, SHRT_MAX); - RNA_def_property_ui_text(prop, "Render Resolution V", "Surface resolution in V direction used while rendering. Zero skips this property"); + RNA_def_property_ui_text(prop, "Render Resolution V", "Surface resolution in V direction used while rendering (zero skips this property)"); prop= RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ctime"); - RNA_def_property_ui_text(prop, "Evaluation Time", "Parametric position along the length of the curve that Objects 'following' it should be at. Position is evaluated by dividing by the 'Path Length' value"); + RNA_def_property_ui_text(prop, "Evaluation Time", "Parametric position along the length of the curve that Objects 'following' it should be at (position is evaluated by dividing by the 'Path Length' value)"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); /* pointers */ @@ -1392,7 +1392,7 @@ static void rna_def_curve(BlenderRNA *brna) /* texture space */ prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", CU_AUTOSPACE); - RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjusts active object's texture space automatically when transforming object"); + RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjust active object's texture space automatically when transforming object"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Curve_texspace_set"); prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index abaeb202ffa..e911c936df8 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -2696,7 +2696,7 @@ int rna_parameter_size_alloc(PropertyRNA *parm) /* Dynamic Enums */ -void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item) +void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item) { EnumPropertyItem *newitems; int tot= *totitem; diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c index abf6b9b0943..8fa92e712d9 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -123,7 +123,7 @@ void RNA_def_group(BlenderRNA *brna) prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER); RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); RNA_def_property_array(prop, 20); - RNA_def_property_ui_text(prop, "Dupli Layers", "Layers visible when this groups is instanced as a dupli"); + RNA_def_property_ui_text(prop, "Dupli Layers", "Layers visible when this group is instanced as a dupli"); prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 737ce73ff1d..6f6a27abe7c 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -462,7 +462,7 @@ static void rna_def_image(BlenderRNA *brna) prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_field_order_items); - RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines are displayed first"); + RNA_def_property_ui_text(prop, "Field Order", "Order of video fields (select which lines are displayed first)"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); /* booleans */ diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 91aa9daac25..b28adeafbc8 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -103,7 +103,7 @@ static void rna_Image_save(Image *image, ReportList *reports) { ImBuf *ibuf= BKE_image_get_ibuf(image, NULL); if(ibuf) { - char filename[FILE_MAXDIR + FILE_MAXFILE]; + char filename[FILE_MAX]; BLI_strncpy(filename, image->name, sizeof(filename)); BLI_path_abs(filename, G.main->name); diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 65dcbc66624..6d47f867237 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -611,13 +611,13 @@ static void rna_def_key(BlenderRNA *brna) prop= RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type", KEY_RELATIVE); - RNA_def_property_ui_text(prop, "Relative", "Makes shape keys relative"); + RNA_def_property_ui_text(prop, "Relative", "Make shape keys relative"); RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "slurph", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "slurph"); RNA_def_property_range(prop, -500, 500); - RNA_def_property_ui_text(prop, "Slurph", "Creates a delay in amount of frames in applying keypositions, first vertex goes first"); + RNA_def_property_ui_text(prop, "Slurph", "Create a delay (in frames) in applying keypositions, first vertex goes first"); RNA_def_property_update(prop, 0, "rna_Key_update_data"); } diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 5b71df86f30..c783fc2238c 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -194,12 +194,12 @@ static void rna_def_lamp_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "use_map_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_COL); - RNA_def_property_ui_text(prop, "Color", "Lets the texture affect the basic color of the lamp"); + RNA_def_property_ui_text(prop, "Color", "Let the texture affect the basic color of the lamp"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "use_map_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_SHAD); - RNA_def_property_ui_text(prop, "Shadow", "Lets the texture affect the shadow color of the lamp"); + RNA_def_property_ui_text(prop, "Shadow", "Let the texture affect the shadow color of the lamp"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE); @@ -359,22 +359,22 @@ static void rna_def_lamp(BlenderRNA *brna) prop= RNA_def_property(srna, "use_own_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER); - RNA_def_property_ui_text(prop, "Layer", "Illuminates objects only on the same layer the lamp is on"); + RNA_def_property_ui_text(prop, "Layer", "Illuminate objects only on the same layers the lamp is on"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG); - RNA_def_property_ui_text(prop, "Negative", "Lamp casts negative light"); + RNA_def_property_ui_text(prop, "Negative", "Cast negative light"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "use_specular", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC); - RNA_def_property_ui_text(prop, "Specular", "Lamp creates specular highlights"); + RNA_def_property_ui_text(prop, "Specular", "Create specular highlights"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "use_diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF); - RNA_def_property_ui_text(prop, "Diffuse", "Lamp does diffuse shading"); + RNA_def_property_ui_text(prop, "Diffuse", "Do diffuse shading"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); /* nodes */ @@ -420,7 +420,7 @@ static void rna_def_lamp_falloff(StructRNA *srna) prop= RNA_def_property(srna, "use_sphere", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE); - RNA_def_property_ui_text(prop, "Sphere", "Sets light intensity to zero beyond lamp distance"); + RNA_def_property_ui_text(prop, "Sphere", "Set light intensity to zero beyond lamp distance"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE); @@ -447,7 +447,7 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) static EnumPropertyItem prop_spot_shadow_items[] = { {0, "NOSHADOW", 0, "No Shadow", ""}, - {LA_SHAD_BUF, "BUFFER_SHADOW", 0, "Buffer Shadow", "Lets spotlight produce shadows using shadow buffer"}, + {LA_SHAD_BUF, "BUFFER_SHADOW", 0, "Buffer Shadow", "Let spotlight produce shadows using shadow buffer"}, {LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow"}, {0, NULL, 0, NULL, NULL}}; @@ -476,7 +476,7 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) prop= RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW); - RNA_def_property_ui_text(prop, "Only Shadow", "Causes light to cast shadows only without illuminating objects"); + RNA_def_property_ui_text(prop, "Only Shadow", "Cast shadows only, without illuminating objects"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_ray_sample_method", PROP_ENUM, PROP_NONE); @@ -488,14 +488,14 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) prop= RNA_def_property(srna, (area)? "shadow_ray_samples_x": "shadow_ray_samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ray_samp"); RNA_def_property_range(prop, 1, 64); - RNA_def_property_ui_text(prop, (area)? "Shadow Ray Samples": "Shadow Ray Samples X","Amount of samples taken extra (samples x samples)"); + RNA_def_property_ui_text(prop, (area)? "Shadow Ray Samples": "Shadow Ray Samples X","Number of samples taken extra (samples x samples)"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); if(area) { prop= RNA_def_property(srna, "shadow_ray_samples_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ray_sampy"); RNA_def_property_range(prop, 1, 64); - RNA_def_property_ui_text(prop, "Shadow Ray Samples Y", "Amount of samples taken extra (samples x samples)"); + RNA_def_property_ui_text(prop, "Shadow Ray Samples Y", "Number of samples taken extra (samples x samples)"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); } @@ -513,7 +513,7 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) prop= RNA_def_property(srna, "use_shadow_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER_SHADOW); - RNA_def_property_ui_text(prop, "Shadow Layer", "Causes only objects on the same layer to cast shadows"); + RNA_def_property_ui_text(prop, "Shadow Layer", "Objects on the same layers only cast shadows"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); } @@ -607,8 +607,8 @@ static void rna_def_spot_lamp(BlenderRNA *brna) static EnumPropertyItem prop_numbuffer_items[] = { {1, "BUFFERS_1", 0, "1", "Only one buffer rendered"}, - {4, "BUFFERS_4", 0, "4", "Renders 4 buffers for better AA, this quadruples memory usage"}, - {9, "BUFFERS_9", 0, "9", "Renders 9 buffers for better AA, this uses nine times more memory"}, + {4, "BUFFERS_4", 0, "4", "Render 4 buffers for better AA, this quadruples memory usage"}, + {9, "BUFFERS_9", 0, "9", "Render 9 buffers for better AA, this uses nine times more memory"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SpotLamp", "Lamp"); @@ -621,12 +621,12 @@ static void rna_def_spot_lamp(BlenderRNA *brna) 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", "Casts a square spot light shape"); + RNA_def_property_ui_text(prop, "Square", "Cast a square spot light shape"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO); - RNA_def_property_ui_text(prop, "Halo", "Renders spotlight with a volumetric halo"); + RNA_def_property_ui_text(prop, "Halo", "Render spotlight with a volumetric halo"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE); @@ -669,7 +669,7 @@ static void rna_def_spot_lamp(BlenderRNA *brna) prop= RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE); // RNA_def_property_float_sdna(prop, NULL, "spotsize"); RNA_def_property_range(prop, M_PI/180.0, M_PI); - RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam in degrees"); + RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam"); RNA_def_property_float_funcs(prop, "rna_Lamp_spot_size_get", "rna_Lamp_spot_size_set", NULL); /* only for deg/rad conversion */ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); @@ -681,13 +681,13 @@ static void rna_def_spot_lamp(BlenderRNA *brna) 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: objects closer will not generate shadows"); + 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"); 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_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"); prop= RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index 640a46d94ba..9fe6b236961 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -260,7 +260,7 @@ static void rna_def_lattice(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "pntsu"); RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_u_set", NULL); RNA_def_property_range(prop, 1, 64); - RNA_def_property_ui_text(prop, "U", "Points in U direction (can't be changed when there are shape keys)"); + RNA_def_property_ui_text(prop, "U", "Point in U direction (can't be changed when there are shape keys)"); RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); RNA_def_property_editable_func(prop, "rna_Lattice_size_editable"); @@ -268,7 +268,7 @@ static void rna_def_lattice(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "pntsv"); RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_v_set", NULL); RNA_def_property_range(prop, 1, 64); - RNA_def_property_ui_text(prop, "V", "Points in V direction (can't be changed when there are shape keys)"); + RNA_def_property_ui_text(prop, "V", "Point in V direction (can't be changed when there are shape keys)"); RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); RNA_def_property_editable_func(prop, "rna_Lattice_size_editable"); @@ -276,7 +276,7 @@ static void rna_def_lattice(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "pntsw"); RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_w_set", NULL); RNA_def_property_range(prop, 1, 64); - RNA_def_property_ui_text(prop, "W", "Points in W direction (can't be changed when there are shape keys)"); + RNA_def_property_ui_text(prop, "W", "Point in W direction (can't be changed when there are shape keys)"); RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); RNA_def_property_editable_func(prop, "rna_Lattice_size_editable"); diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index f568f6de855..1809a5313c5 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -1329,7 +1329,7 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "load", "rna_Main_texts_load"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Add a new text to the main database from a file"); - parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock"); + parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock"); @@ -1515,7 +1515,7 @@ void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "load", "rna_Main_movieclip_load"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Add a new movie clip to the main database from a file"); - parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock"); + parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ parm= RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip datablock"); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index ce8f903bfe2..6400946d582 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -39,18 +39,18 @@ #include "WM_types.h" static EnumPropertyItem prop_texture_coordinates_items[] = { -{TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates"}, -{TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates"}, -{TEXCO_UV, "UV", 0, "UV", "Uses UV coordinates for texture coordinates"}, -{TEXCO_ORCO, "ORCO", 0, "Generated", "Uses the original undeformed coordinates of the object"}, +{TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"}, +{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"}, +{TEXCO_UV, "UV", 0, "UV", "Use UV coordinates for texture coordinates"}, +{TEXCO_ORCO, "ORCO", 0, "Generated", "Use the original undeformed coordinates of the object"}, {TEXCO_STRAND, "STRAND", 0, "Strand / Particle", - "Uses normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"}, -{TEXCO_STICKY, "STICKY", 0, "Sticky", "Uses mesh's sticky coordinates for the texture coordinates"}, -{TEXCO_WINDOW, "WINDOW", 0, "Window", "Uses screen coordinates as texture coordinates"}, -{TEXCO_NORM, "NORMAL", 0, "Normal", "Uses normal vector as texture coordinates"}, -{TEXCO_REFL, "REFLECTION", 0, "Reflection", "Uses reflection vector as texture coordinates"}, -{TEXCO_STRESS, "STRESS", 0, "Stress", "Uses the difference of edge lengths compared to original coordinates of the mesh"}, -{TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Uses the optional tangent vector as texture coordinates"}, + "Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"}, +{TEXCO_STICKY, "STICKY", 0, "Sticky", "Use mesh's sticky coordinates for the texture coordinates"}, +{TEXCO_WINDOW, "WINDOW", 0, "Window", "Use screen coordinates as texture coordinates"}, +{TEXCO_NORM, "NORMAL", 0, "Normal", "Use normal vector as texture coordinates"}, +{TEXCO_REFL, "REFLECTION", 0, "Reflection", "Use reflection vector as texture coordinates"}, +{TEXCO_STRESS, "STRESS", 0, "Stress", "Use the difference of edge lengths compared to original coordinates of the mesh"}, +{TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Use the optional tangent vector as texture coordinates"}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem ramp_blend_items[] = { @@ -460,62 +460,62 @@ static void rna_def_material_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "use_map_color_diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COL); - RNA_def_property_ui_text(prop, "Diffuse Color", "Causes the texture to affect basic color of the material"); + RNA_def_property_ui_text(prop, "Diffuse Color", "The texture affects basic color of the material"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_NORM); - RNA_def_property_ui_text(prop, "Normal", "Causes the texture to affect the rendered normal"); + RNA_def_property_ui_text(prop, "Normal", "The texture affects the rendered normal"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_color_spec", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLSPEC); - RNA_def_property_ui_text(prop, "Specular Color", "Causes the texture to affect the specularity color"); + RNA_def_property_ui_text(prop, "Specular Color", "The texture affects the specularity color"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_mirror", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLMIR); - RNA_def_property_ui_text(prop, "Mirror", "Causes the texture to affect the mirror color"); + RNA_def_property_ui_text(prop, "Mirror", "The texture affects the mirror color"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REF); - RNA_def_property_ui_text(prop, "Diffuse", "Causes the texture to affect the value of the materials diffuse reflectivity"); + RNA_def_property_ui_text(prop, "Diffuse", "The texture to affects the value of the materials diffuse reflectivity"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_specular", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SPEC); - RNA_def_property_ui_text(prop, "Specular", "Causes the texture to affect the value of specular reflectivity"); + RNA_def_property_ui_text(prop, "Specular", "The texture to affects the value of specular reflectivity"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_ambient", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_AMB); - RNA_def_property_ui_text(prop, "Ambient", "Causes the texture to affect the value of ambient"); + RNA_def_property_ui_text(prop, "Ambient", "The texture affects the value of ambient"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_hardness", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_HAR); - RNA_def_property_ui_text(prop, "Hardness", "Causes the texture to affect the hardness value"); + RNA_def_property_ui_text(prop, "Hardness", "The texture affects the hardness value"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_raymir", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_RAYMIRR); - RNA_def_property_ui_text(prop, "Ray-Mirror", "Causes the texture to affect the ray-mirror value"); + RNA_def_property_ui_text(prop, "Ray-Mirror", "The texture affects the ray-mirror value"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ALPHA); - RNA_def_property_ui_text(prop, "Alpha", "Causes the texture to affect the alpha value"); + RNA_def_property_ui_text(prop, "Alpha", "The texture affects the alpha value"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_emit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMIT); - RNA_def_property_ui_text(prop, "Emit", "Causes the texture to affect the emit value"); + RNA_def_property_ui_text(prop, "Emit", "The texture affects the emit value"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_translucency", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSLU); - RNA_def_property_ui_text(prop, "Translucency", "Causes the texture to affect the translucency value"); + RNA_def_property_ui_text(prop, "Translucency", "The texture affects the translucency value"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_displacement", PROP_BOOLEAN, PROP_NONE); @@ -644,38 +644,38 @@ static void rna_def_material_mtex(BlenderRNA *brna) /* volume material */ prop= RNA_def_property(srna, "use_map_color_emission", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION_COL); - RNA_def_property_ui_text(prop, "Emission Color", "Causes the texture to affect the color of emission"); + RNA_def_property_ui_text(prop, "Emission Color", "The texture affects the color of emission"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_color_reflection", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REFLECTION_COL); - RNA_def_property_ui_text(prop, "Reflection Color", "Causes the texture to affect the color of scattered light"); + RNA_def_property_ui_text(prop, "Reflection Color", "The texture affects the color of scattered light"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_color_transmission", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSMISSION_COL); RNA_def_property_ui_text(prop, "Transmission Color", - "Causes the texture to affect the result color after other light has been scattered/absorbed"); + "The texture affects the result color after other light has been scattered/absorbed"); RNA_def_property_update(prop, NC_TEXTURE, NULL); prop= RNA_def_property(srna, "use_map_density", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DENSITY); - RNA_def_property_ui_text(prop, "Density", "Causes the texture to affect the volume's density"); + RNA_def_property_ui_text(prop, "Density", "The texture affects the volume's density"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_emission", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION); - RNA_def_property_ui_text(prop, "Emission", "Causes the texture to affect the volume's emission"); + RNA_def_property_ui_text(prop, "Emission", "The texture affects the volume's emission"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_scatter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SCATTERING); - RNA_def_property_ui_text(prop, "Scattering", "Causes the texture to affect the volume's scattering"); + RNA_def_property_ui_text(prop, "Scattering", "The texture affects the volume's scattering"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_reflect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REFLECTION); - RNA_def_property_ui_text(prop, "Reflection", "Causes the texture to affect the reflected light's brightness"); + RNA_def_property_ui_text(prop, "Reflection", "The texture affects the reflected light's brightness"); RNA_def_property_update(prop, NC_TEXTURE, NULL); prop= RNA_def_property(srna, "emission_color_factor", PROP_FLOAT, PROP_NONE); @@ -876,13 +876,13 @@ static void rna_def_material_colors(StructRNA *srna) prop= RNA_def_property(srna, "diffuse_ramp_input", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampin_col"); RNA_def_property_enum_items(prop, prop_ramp_input_items); - RNA_def_property_ui_text(prop, "Diffuse Ramp Input", "Determines how the ramp maps on the surface"); + RNA_def_property_ui_text(prop, "Diffuse Ramp Input", "How the ramp maps on the surface"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_ramp_input", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampin_spec"); RNA_def_property_enum_items(prop, prop_ramp_input_items); - RNA_def_property_ui_text(prop, "Specular Ramp Input", "Determines how the ramp maps on the surface"); + RNA_def_property_ui_text(prop, "Specular Ramp Input", "How the ramp maps on the surface"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_ramp_factor", PROP_FLOAT, PROP_FACTOR); @@ -1549,7 +1549,7 @@ static void rna_def_material_strand(BlenderRNA *brna) prop= RNA_def_property(srna, "use_tangent_shading", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_STR); - RNA_def_property_ui_text(prop, "Tangent Shading", "Uses direction of strands as normal for tangent-shading"); + RNA_def_property_ui_text(prop, "Tangent Shading", "Use direction of strands as normal for tangent-shading"); RNA_def_property_update(prop, 0, "rna_Material_update"); /* this flag is only set when rendering, not to be edited manually */ @@ -1670,12 +1670,12 @@ void RNA_def_material(BlenderRNA *brna) /* Render Preview Types */ static EnumPropertyItem preview_type_items[] = { - {MA_FLAT, "FLAT", ICON_MATPLANE, "Flat", "Preview type: Flat XY plane"}, - {MA_SPHERE, "SPHERE", ICON_MATSPHERE, "Sphere", "Preview type: Sphere"}, - {MA_CUBE, "CUBE", ICON_MATCUBE, "Flat", "Preview type: Cube"}, - {MA_MONKEY, "MONKEY", ICON_MONKEY, "Flat", "Preview type: Monkey"}, - {MA_HAIR, "HAIR", ICON_HAIR, "Flat", "Preview type: Hair strands"}, - {MA_SPHERE_A, "SPHERE_A", ICON_MAT_SPHERE_SKY, "Flat", "Preview type: Large sphere with sky"}, + {MA_FLAT, "FLAT", ICON_MATPLANE, "Flat", "Flat XY plane"}, + {MA_SPHERE, "SPHERE", ICON_MATSPHERE, "Sphere", "Sphere"}, + {MA_CUBE, "CUBE", ICON_MATCUBE, "Cube", "Cube"}, + {MA_MONKEY, "MONKEY", ICON_MONKEY, "Monkey", "Monkey"}, + {MA_HAIR, "HAIR", ICON_HAIR, "Hair", "Hair strands"}, + {MA_SPHERE_A, "SPHERE_A", ICON_MAT_SPHERE_SKY, "World Sphere", "Large sphere with sky"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_shadows_only_items[] = { @@ -1752,7 +1752,7 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "lbias"); RNA_def_property_range(prop, 0, 10); - RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Factor to multiply shadow buffer bias with (0 is ignore.)"); + RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Factor to multiply shadow buffer bias with (0 is ignore)"); prop= RNA_def_property(srna, "shadow_cast_alpha", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "shad_alpha"); @@ -1770,7 +1770,7 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "index"); - RNA_def_property_ui_text(prop, "Pass Index", "Index # for the IndexMA render pass"); + RNA_def_property_ui_text(prop, "Pass Index", "Index number for the IndexMA render pass"); RNA_def_property_update(prop, NC_OBJECT, NULL); /* flags */ diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 5f948a3a243..5f33eac3e8f 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -314,7 +314,7 @@ static void rna_def_metaball(BlenderRNA *brna) /* texture space */ prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MB_AUTOSPACE); - RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjusts active object's texture space automatically when transforming object"); + RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjust active object's texture space automatically when transforming object"); prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_array(prop, 3); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 4ef5411af0a..0bbe253072a 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -787,10 +787,10 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) static void rna_def_modifier_generic_map_info(StructRNA *srna) { static EnumPropertyItem prop_texture_coordinates_items[] = { - {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Map", "Uses the local coordinate system for the texture coordinates"}, - {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Uses the global coordinate system for the texture coordinates"}, - {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", "Uses the linked object's local coordinate system for the texture coordinates"}, - {MOD_DISP_MAP_UV, "UV", 0, "UV", "Uses UV coordinates for the texture coordinates"}, + {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Map", "Use the local coordinate system for the texture coordinates"}, + {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Use the global coordinate system for the texture coordinates"}, + {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", "Use the linked object's local coordinate system for the texture coordinates"}, + {MOD_DISP_MAP_UV, "UV", 0, "UV", "Use UV coordinates for the texture coordinates"}, {0, NULL, 0, NULL, NULL}}; PropertyRNA *prop; @@ -1290,12 +1290,12 @@ static void rna_def_modifier_armature(BlenderRNA *brna) prop= RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE); - RNA_def_property_ui_text(prop, "Use Bone Envelopes", "Binds Bone envelope to armature modifier"); + RNA_def_property_ui_text(prop, "Use Bone Envelopes", "Bind Bone envelopes to armature modifier"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_vertex_groups", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP); - RNA_def_property_ui_text(prop, "Use Vertex Groups", "Binds vertex group to armature modifier"); + RNA_def_property_ui_text(prop, "Use Vertex Groups", "Bind vertex groups to armature modifier"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE); @@ -1387,9 +1387,9 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_operation_items[] = { - {eBooleanModifierOp_Intersect, "INTERSECT", 0, "Intersect", "Keeps the part of the mesh that intersects with the other selected object"}, - {eBooleanModifierOp_Union, "UNION", 0, "Union", "Combines two meshes in an additive way"}, - {eBooleanModifierOp_Difference, "DIFFERENCE", 0, "Difference", "Combines two meshes in a subtractive way"}, + {eBooleanModifierOp_Intersect, "INTERSECT", 0, "Intersect", "Keep the part of the mesh that intersects with the other selected object"}, + {eBooleanModifierOp_Union, "UNION", 0, "Union", "Combine two meshes in an additive way"}, + {eBooleanModifierOp_Difference, "DIFFERENCE", 0, "Difference", "Combine two meshes in a subtractive way"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "BooleanModifier", "Modifier"); @@ -1498,7 +1498,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) prop= RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "offset_ob"); - RNA_def_property_ui_text(prop, "Object Offset", "Uses the location and rotation of another object to determine the distance and rotational change between arrayed items"); + RNA_def_property_ui_text(prop, "Object Offset", "Use the location and rotation of another object to determine the distance and rotational change between arrayed items"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -1556,11 +1556,11 @@ static void rna_def_modifier_displace(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_direction_items[] = { - {MOD_DISP_DIR_X, "X", 0, "X", "Uses the texture's intensity value to displace in the X direction"}, - {MOD_DISP_DIR_Y, "Y", 0, "Y", "Uses the texture's intensity value to displace in the Y direction"}, - {MOD_DISP_DIR_Z, "Z", 0, "Z", "Uses the texture's intensity value to displace in the Z direction"}, - {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal", "Uses the texture's intensity value to displace in the normal direction"}, - {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", "Uses the texture's RGB values to displace the mesh in the XYZ direction"}, + {MOD_DISP_DIR_X, "X", 0, "X", "Use the texture's intensity value to displace in the X direction"}, + {MOD_DISP_DIR_Y, "Y", 0, "Y", "Use the texture's intensity value to displace in the Y direction"}, + {MOD_DISP_DIR_Z, "Z", 0, "Z", "Use the texture's intensity value to displace in the Z direction"}, + {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal", "Use the texture's intensity value to displace in the normal direction"}, + {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", "Use the texture's RGB values to displace the mesh in the XYZ direction"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "DisplaceModifier", "Modifier"); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index af7b3303df1..349f5cddcfb 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -3207,7 +3207,7 @@ static void rna_def_nodetree(BlenderRNA *brna) PropertyRNA *prop; srna = RNA_def_struct(brna, "NodeTree", "ID"); - RNA_def_struct_ui_text(srna, "Node Tree", "Node tree consisting of linked nodes used for materials, textures and compositing"); + RNA_def_struct_ui_text(srna, "Node Tree", "Node tree consisting of linked nodes used for shading, textures and compositing"); RNA_def_struct_sdna(srna, "bNodeTree"); RNA_def_struct_ui_icon(srna, ICON_NODETREE); RNA_def_struct_refine_func(srna, "rna_NodeTree_refine"); @@ -3274,7 +3274,7 @@ static void rna_def_shader_nodetree(BlenderRNA *brna) PropertyRNA *prop; srna = RNA_def_struct(brna, "ShaderNodeTree", "NodeTree"); - RNA_def_struct_ui_text(srna, "Shader Node Tree", "Node tree consisting of linked nodes used for materials"); + RNA_def_struct_ui_text(srna, "Shader Node Tree", "Node tree consisting of linked nodes used for materials (and other shading datablocks)"); RNA_def_struct_sdna(srna, "bNodeTree"); RNA_def_struct_ui_icon(srna, ICON_NODETREE); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index c94a3847a0d..8d299c5b41f 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -2191,7 +2191,7 @@ static void rna_def_object(BlenderRNA *brna) /* render */ prop= RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "index"); - RNA_def_property_ui_text(prop, "Pass Index", "Index # for the IndexOB render pass"); + RNA_def_property_ui_text(prop, "Pass Index", "Index number for the IndexOB render pass"); RNA_def_property_update(prop, NC_OBJECT, NULL); prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); @@ -2252,13 +2252,13 @@ static void rna_def_object(BlenderRNA *brna) // XXX: evil old crap prop= RNA_def_property(srna, "use_slow_parent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "partype", PARSLOW); - RNA_def_property_ui_text(prop, "Slow Parent", "Create a delay in the parent relationship (Beware: this isn't renderfarm safe and may be invalid after jumping around the timeline)"); + RNA_def_property_ui_text(prop, "Slow Parent", "Create a delay in the parent relationship (beware: this isn't renderfarm safe and may be invalid after jumping around the timeline)"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "slow_parent_offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_TIME); RNA_def_property_float_sdna(prop, NULL, "sf"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Slow Parent Offset", "Amount of delay in the parent relationship"); + RNA_def_property_ui_text(prop, "Slow Parent Offset", "Delay in the parent relationship"); RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); /* duplicates */ diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 592c3baec46..2997acd2267 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -214,21 +214,16 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P static void rna_Cache_list_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Object *ob = ptr->id.data; PointCache *cache= ptr->data; - PTCacheID *pid; - ListBase pidlist; + ListBase lb; - BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0); + while(cache->prev) + cache= cache->prev; - for(pid=pidlist.first; pid; pid=pid->next) { - if(pid->cache == cache) { - rna_iterator_listbase_begin(iter, pid->ptcaches, NULL); - break; - } - } + lb.first= cache; + lb.last= NULL; /* not used by listbase_begin */ - BLI_freelistN(&pidlist); + rna_iterator_listbase_begin(iter, &lb, NULL); } static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min, int *max) { @@ -308,8 +303,7 @@ static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max) for(pid=pidlist.first; pid; pid=pid->next) { if(pid->cache == cache) { - if(ELEM3(pid->type, PTCACHE_TYPE_CLOTH, PTCACHE_TYPE_SMOKE_DOMAIN, PTCACHE_TYPE_SMOKE_HIGHRES)) - *max= 1; + *max= pid->max_step; break; } } diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 2b26a09a646..fb6e837365d 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1639,7 +1639,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "use_dynamic_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROT_DYN); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Dynamic", "Sets rotation to dynamic/constant"); + RNA_def_property_ui_text(prop, "Dynamic", "Set rotation to dynamic/constant"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "use_multiply_size_mass", PROP_BOOLEAN, PROP_NONE); @@ -1898,7 +1898,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "material", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "omat"); RNA_def_property_range(prop, 1, 32767); - RNA_def_property_ui_text(prop, "Material", "Specify material used for the particles"); + RNA_def_property_ui_text(prop, "Material", "Material used for the particles"); RNA_def_property_update(prop, 0, "rna_Particle_redo"); @@ -1912,7 +1912,9 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, integrator_type_items); - RNA_def_property_ui_text(prop, "Integration", "Algorithm used to calculate physics. Fastest to most stable/accurate: Midpoint, Euler, Verlet, RK4 (Old)"); + RNA_def_property_ui_text(prop, "Integration", + "Algorithm used to calculate physics, from the fastest to the " + "most stable/accurate: Midpoint, Euler, Verlet, RK4 (Old)"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "kink", PROP_ENUM, PROP_NONE); @@ -1941,7 +1943,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "bb_uv_split"); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_range(prop, 1, 10, 1, 0); - RNA_def_property_ui_text(prop, "UV Split", "Amount of rows/columns to split UV coordinates for billboards"); + RNA_def_property_ui_text(prop, "UV Split", "Number of rows/columns to split UV coordinates for billboards"); prop= RNA_def_property(srna, "billboard_animation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "bb_anim"); @@ -2030,7 +2032,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL); - RNA_def_property_ui_text(prop, "Start", "Frame # to start emitting particles"); + RNA_def_property_ui_text(prop, "Start", "Frame number to start emitting particles"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE); @@ -2039,12 +2041,12 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_end_set", NULL); - RNA_def_property_ui_text(prop, "End", "Frame # to stop emitting particles"); + RNA_def_property_ui_text(prop, "End", "Frame number to stop emitting particles"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME); RNA_def_property_range(prop, 1.0f, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Lifetime", "Specify the life span of the particles"); + RNA_def_property_ui_text(prop, "Lifetime", "Life span of the particles"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "lifetime_random", PROP_FLOAT, PROP_NONE); @@ -2104,7 +2106,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) /* each cached frame takes around 0.5 Gb of memory / disk space depending on cache mode. */ RNA_def_property_range(prop, 0, 10000000); RNA_def_property_ui_range(prop, 0, 100000, 1, 0); - RNA_def_property_ui_text(prop, "Amount", "Total number of particles"); + RNA_def_property_ui_text(prop, "Number", "Total number of particles"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);//TODO: can we get a better name for userjit? @@ -2132,7 +2134,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) /* in theory PROP_ANIMATABLE perhaps should be cleared, but animating this can give some interesting results! */ RNA_def_property_range(prop, 0, 10000); /* 10000 effectors will bel SLOW, but who knows */ RNA_def_property_ui_range(prop, 0, 100, 1, 0); - RNA_def_property_ui_text(prop, "Effector Amount", "How many particles are effectors (0 is all particles)"); + RNA_def_property_ui_text(prop, "Effector Number", "How many particles are effectors (0 is all particles)"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* initial velocity factors */ @@ -2180,7 +2182,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "reactor_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "reactfac"); RNA_def_property_range(prop, -10.0f, 10.0f); - RNA_def_property_ui_text(prop, "Reactor", "Let the vector away from the target particles location give the particle a starting speed"); + RNA_def_property_ui_text(prop, "Reactor", "Let the vector away from the target particle's location give the particle a starting speed"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "object_align_factor", PROP_FLOAT, PROP_VELOCITY); @@ -2227,7 +2229,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.001f, 100000.0f); RNA_def_property_ui_range(prop, 0.01, 100, 1, 3); - RNA_def_property_ui_text(prop, "Mass", "Specify the mass of the particles"); + RNA_def_property_ui_text(prop, "Mass", "Mass of the particles"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE); @@ -2248,20 +2250,20 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dragfac"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Drag", "Specify the amount of air-drag"); + RNA_def_property_ui_text(prop, "Drag", "Amount of air-drag"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "brownian_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "brownfac"); RNA_def_property_range(prop, 0.0f, 200.0f); RNA_def_property_ui_range(prop, 0, 20, 1, 3); - RNA_def_property_ui_text(prop, "Brownian", "Specify the amount of Brownian motion"); + RNA_def_property_ui_text(prop, "Brownian", "Amount of Brownian motion"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dampfac"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Damp", "Specify the amount of damping"); + RNA_def_property_ui_text(prop, "Damp", "Amount of damping"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* random length */ @@ -2276,14 +2278,14 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "child_nbr");//optional if prop names are the same RNA_def_property_range(prop, 0, 100000); RNA_def_property_ui_range(prop, 0, 1000, 1, 0); - RNA_def_property_ui_text(prop, "Children Per Parent", "Amount of children/parent"); + RNA_def_property_ui_text(prop, "Children Per Parent", "Number of children/parent"); RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rendered_child_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ren_child_nbr"); RNA_def_property_range(prop, 0, 100000); RNA_def_property_ui_range(prop, 0, 10000, 1, 0); - RNA_def_property_ui_text(prop, "Rendered Children", "Amount of children/parent for rendering"); + RNA_def_property_ui_text(prop, "Rendered Children", "Number of children/parent for rendering"); prop= RNA_def_property(srna, "virtual_parents", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "parents"); @@ -2341,7 +2343,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "kink_amplitude_clump", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "kink_amp_clump"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Amplitude Clump", "How much clump effects kink amplitude"); + RNA_def_property_ui_text(prop, "Amplitude Clump", "How much clump affects kink amplitude"); RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "kink_frequency", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 6290c01f992..0315352f2c8 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -1139,7 +1139,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna) prop= RNA_def_property(srna, "step_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "numstep"); RNA_def_property_range(prop, 1.f, 50.f); - RNA_def_property_ui_text(prop, "Num steps", "Divides the frame interval into this many steps"); + RNA_def_property_ui_text(prop, "Num steps", "Divide the frame interval into this many steps"); RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); @@ -1152,7 +1152,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna) RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_itasc_reiteration_items); RNA_def_property_ui_text(prop, "Reiteration", - "Defines if the solver is allowed to reiterate (converges until " + "Defines if the solver is allowed to reiterate (converge until " "precision is met) on none, first or all frames"); RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); @@ -1178,19 +1178,19 @@ static void rna_def_pose_itasc(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "feedback"); RNA_def_property_range(prop, 0.0f,100.0f); RNA_def_property_ui_text(prop, "Feedback", - "Feedback coefficient for error correction. Average response time=1/feedback. Default=20"); + "Feedback coefficient for error correction, average response time is 1/feedback (default=20)"); RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); prop= RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxvel"); RNA_def_property_range(prop, 0.0f,100.0f); - RNA_def_property_ui_text(prop, "Max Velocity", "Maximum joint velocity in rad/s. Default=50"); + RNA_def_property_ui_text(prop, "Max Velocity", "Maximum joint velocity in rad/s (default=50)"); RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); prop= RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "solver"); RNA_def_property_enum_items(prop, prop_solver_items); - RNA_def_property_ui_text(prop, "Solver", "Solving method selection: Automatic damping or manual damping"); + RNA_def_property_ui_text(prop, "Solver", "Solving method selection: automatic damping or manual damping"); RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild"); prop= RNA_def_property(srna, "damping_max", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 1ee24a508b6..eef7cddf088 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -219,6 +219,10 @@ EnumPropertyItem image_color_mode_items[] ={ {R_IMF_PLANES_RGBA, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"}, {0, NULL, 0, NULL, NULL}}; +#define IMAGE_COLOR_MODE_BW image_color_mode_items[0] +#define IMAGE_COLOR_MODE_RGB image_color_mode_items[1] +#define IMAGE_COLOR_MODE_RGBA image_color_mode_items[2] + EnumPropertyItem image_color_depth_items[] = { /* 1 (monochrome) not used */ {R_IMF_CHAN_DEPTH_8, "8", 0, "8", "8 bit color channels"}, @@ -617,11 +621,16 @@ static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value) { ImageFormatData *imf= (ImageFormatData *)ptr->data; ID *id= ptr->id.data; + const char is_render= (id && GS(id->name) == ID_SCE); + /* see note below on why this is */ + const char chan_flag= BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0); imf->imtype= value; /* ensure depth and color settings match */ - if (!BKE_imtype_supports_alpha(imf->imtype)) { + if ( ((imf->planes == R_IMF_PLANES_BW) && !(chan_flag & IMA_CHAN_FLAG_BW)) || + ((imf->planes == R_IMF_PLANES_RGBA) && !(chan_flag & IMA_CHAN_FLAG_ALPHA))) + { imf->planes= R_IMF_PLANES_RGB; } @@ -677,16 +686,30 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext *C, P PropertyRNA *UNUSED(prop), int *free) { ImageFormatData *imf= (ImageFormatData *)ptr->data; + ID *id= ptr->id.data; + const char is_render= (id && GS(id->name) == ID_SCE); - if ((imf == NULL) || BKE_imtype_supports_alpha(imf->imtype)) { + /* note, we need to act differently for render + * where 'BW' will force greyscale even if the output format writes + * as RGBA, this is age old blender convention and not sure how useful + * it really is but keep it for now - campbell */ + const char chan_flag= BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0); + + if (chan_flag == (IMA_CHAN_FLAG_BW|IMA_CHAN_FLAG_RGB|IMA_CHAN_FLAG_ALPHA)) { return image_color_mode_items; } else { - static EnumPropertyItem color_mode_items[] ={ - {R_IMF_PLANES_BW, "BW", 0, "BW", "Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF)"}, - {R_IMF_PLANES_RGB, "RGB", 0, "RGB", "Images are saved with RGB (color) data"}, - {0, NULL, 0, NULL, NULL}}; - return color_mode_items; + int totitem= 0; + EnumPropertyItem *item= NULL; + + if (chan_flag & IMA_CHAN_FLAG_BW) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_BW); + if (chan_flag & IMA_CHAN_FLAG_RGB) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGB); + if (chan_flag & IMA_CHAN_FLAG_ALPHA) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGBA); + + RNA_enum_item_end(&item, &totitem); + *free= 1; + + return item; } } @@ -2477,7 +2500,7 @@ static void rna_def_scene_image_format_data(BlenderRNA *brna) /* flag */ prop= RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", R_IMF_FLAG_ZBUF); - RNA_def_property_ui_text(prop, "Z Buffer", "Save the z-depth per pixel (32 bit unsigned int z-buffer)Save the z-depth per pixel (32 bit unsigned int z-buffer)"); + RNA_def_property_ui_text(prop, "Z Buffer", "Save the z-depth per pixel (32 bit unsigned int z-buffer)"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "use_preview", PROP_BOOLEAN, PROP_NONE); @@ -2729,18 +2752,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_RenderSettings_path"); RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock"); -#if 0 /* moved */ - - prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes"); - RNA_def_property_enum_items(prop, image_color_mode_items); - RNA_def_property_ui_text(prop, "Color Mode", - "Choose BW for saving greyscale images, RGB for saving red, green and blue channels, " - "and RGBA for saving red, green, blue and alpha channels"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - -#endif - /* Render Data */ prop= RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); diff --git a/source/blender/makesrna/intern/rna_speaker.c b/source/blender/makesrna/intern/rna_speaker.c index 3b7571343da..cb2b1fe4c60 100644 --- a/source/blender/makesrna/intern/rna_speaker.c +++ b/source/blender/makesrna/intern/rna_speaker.c @@ -60,7 +60,7 @@ static void rna_def_speaker(BlenderRNA *brna) prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_MUTED); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Mute", "Mutes the speaker"); + RNA_def_property_ui_text(prop, "Mute", "Mute the speaker"); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* This shouldn't be changed actually, hiding it! @@ -124,7 +124,7 @@ static void rna_def_speaker(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, 360.0f); RNA_def_property_ui_text(prop, "Outer Cone Angle", - "Outer angle of the cone in degrees, outside this cone the volume is " + "Angle of the outer cone, in degrees, outside this cone the volume is " "the outer cone volume, between inner and outer cone the volume is interpolated"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_outer_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); @@ -134,7 +134,7 @@ static void rna_def_speaker(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, 360.0f); RNA_def_property_ui_text(prop, "Inner Cone Angle", - "Inner angle of the cone in degrees, inside the cone the volume is 100 %"); + "Angle of the inner cone, in degrees, inside the cone the volume is 100 %"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_inner_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index e2c105e9ba8..ba8460e5477 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -58,22 +58,22 @@ EnumPropertyItem texture_type_items[] = { {TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", "Procedural - create a ramp texture"}, {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", "Procedural - create a cloud-like fractal noise texture"}, {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, - "Distorted Noise", "Procedural - Noise texture distorted by two noise algorithms"}, + "Distorted Noise", "Procedural - noise texture distorted by two noise algorithms"}, {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA, "Environment Map", "Create a render of the environment mapped to a texture"}, {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", "Allow for images or movies to be used as textures"}, - {TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", "Procedural - Color texture based on trigonometric functions"}, - {TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", "Procedural - Marble-like noise texture with wave generated bands"}, - {TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", "Procedural - Highly flexible fractal noise texture"}, + {TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", "Procedural - color texture based on trigonometric functions"}, + {TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", "Procedural - marble-like noise texture with wave generated bands"}, + {TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", "Procedural - highly flexible fractal noise texture"}, {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", - "Procedural - Random noise, gives a different result every time, for every frame, for every pixel"}, + "Procedural - random noise, gives a different result every time, for every frame, for every pixel"}, //{TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""}, /* Nothing yet */ {TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""}, - {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - Create a fractal noise texture"}, - {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - Create cell-like patterns based on Worley noise"}, + {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - create a fractal noise texture"}, + {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - create cell-like patterns based on Worley noise"}, {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Create a 3d texture based on volumetric data"}, - {TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - Wave generated bands or rings, with optional noise"}, - {TEX_OCEAN, "OCEAN", ICON_TEXTURE, "Ocean", ""}, + {TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - wave generated bands or rings, with optional noise"}, + {TEX_OCEAN, "OCEAN", ICON_TEXTURE, "Ocean", "Use a texture generated by an Ocean modifier"}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem blend_type_items[] = { @@ -667,7 +667,7 @@ static void rna_def_filter_common(StructRNA *srna) prop= RNA_def_property(srna, "use_mipmap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP); RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set"); - RNA_def_property_ui_text(prop, "MIP Map", "Uses auto-generated MIP maps for the image"); + RNA_def_property_ui_text(prop, "MIP Map", "Use auto-generated MIP maps for the image"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "use_mipmap_gauss", PROP_BOOLEAN, PROP_NONE); @@ -685,14 +685,14 @@ static void rna_def_filter_common(StructRNA *srna) RNA_def_property_int_sdna(prop, NULL, "afmax"); RNA_def_property_range(prop, 1, 256); RNA_def_property_ui_text(prop, "Filter Probes", - "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower"); + "Maximum number of samples (higher gives less blur at distant/oblique angles, but is also slower)"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "afmax"); RNA_def_property_range(prop, 1, 256); RNA_def_property_ui_text(prop, "Filter Eccentricity", - "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower"); + "Maximum eccentricity (higher gives less blur at distant/oblique angles, but is also slower)"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "use_filter_size_min", PROP_BOOLEAN, PROP_NONE); @@ -838,20 +838,20 @@ static void rna_def_texture_clouds(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "noisesize"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); - RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); + RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "noisedepth"); RNA_def_property_range(prop, 0, 30); RNA_def_property_ui_range(prop, 0, 24, 0, 2); - RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation"); + RNA_def_property_ui_text(prop, "Noise Depth", "Depth of the cloud calculation"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); - RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); @@ -863,7 +863,7 @@ static void rna_def_texture_clouds(BlenderRNA *brna) prop= RNA_def_property(srna, "cloud_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_clouds_stype); - RNA_def_property_ui_text(prop, "Color", "Determines whether Noise returns grayscale or RGB values"); + RNA_def_property_ui_text(prop, "Color", "Determine whether Noise returns grayscale or RGB values"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); @@ -879,16 +879,16 @@ static void rna_def_texture_wood(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_wood_stype[] = { - {TEX_BAND, "BANDS", 0, "Bands", "Uses standard wood texture in bands"}, - {TEX_RING, "RINGS", 0, "Rings", "Uses wood texture in rings"}, - {TEX_BANDNOISE, "BANDNOISE", 0, "Band Noise", "Adds noise to standard wood"}, - {TEX_RINGNOISE, "RINGNOISE", 0, "Ring Noise", "Adds noise to rings"}, + {TEX_BAND, "BANDS", 0, "Bands", "Use standard wood texture in bands"}, + {TEX_RING, "RINGS", 0, "Rings", "Use wood texture in rings"}, + {TEX_BANDNOISE, "BANDNOISE", 0, "Band Noise", "Add noise to standard wood"}, + {TEX_RINGNOISE, "RINGNOISE", 0, "Ring Noise", "Add noise to rings"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_wood_noisebasis2[] = { - {TEX_SIN, "SIN", 0, "Sine", "Uses a sine wave to produce bands"}, - {TEX_SAW, "SAW", 0, "Saw", "Uses a saw wave to produce bands"}, - {TEX_TRI, "TRI", 0, "Tri", "Uses a triangle wave to produce bands"}, + {TEX_SIN, "SIN", 0, "Sine", "Use a sine wave to produce bands"}, + {TEX_SAW, "SAW", 0, "Saw", "Use a saw wave to produce bands"}, + {TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "WoodTexture", "Texture"); @@ -899,20 +899,20 @@ static void rna_def_texture_wood(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "noisesize"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); - RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); + RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "turbul"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); - RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types"); + RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the bandnoise and ringnoise types"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); - RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); @@ -947,15 +947,15 @@ static void rna_def_texture_marble(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_marble_stype[] = { - {TEX_SOFT, "SOFT", 0, "Soft", "Uses soft marble"}, - {TEX_SHARP, "SHARP", 0, "Sharp", "Uses more clearly defined marble"}, - {TEX_SHARPER, "SHARPER", 0, "Sharper", "Uses very clearly defined marble"}, + {TEX_SOFT, "SOFT", 0, "Soft", "Use soft marble"}, + {TEX_SHARP, "SHARP", 0, "Sharp", "Use more clearly defined marble"}, + {TEX_SHARPER, "SHARPER", 0, "Sharper", "Use very clearly defined marble"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_marble_noisebasis2[] = { - {TEX_SIN, "SIN", 0, "Sin", "Uses a sine wave to produce bands"}, - {TEX_SAW, "SAW", 0, "Saw", "Uses a saw wave to produce bands"}, - {TEX_TRI, "TRI", 0, "Tri", "Uses a triangle wave to produce bands"}, + {TEX_SIN, "SIN", 0, "Sin", "Use a sine wave to produce bands"}, + {TEX_SAW, "SAW", 0, "Saw", "Use a saw wave to produce bands"}, + {TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "MarbleTexture", "Texture"); @@ -966,21 +966,21 @@ static void rna_def_texture_marble(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "noisesize"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); - RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); + RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "turbul"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); - RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types"); + RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the bandnoise and ringnoise types"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "noisedepth"); RNA_def_property_range(prop, 0, 30); RNA_def_property_ui_range(prop, 0, 24, 0, 2); - RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation"); + RNA_def_property_ui_text(prop, "Noise Depth", "Depth of the cloud calculation"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); @@ -998,7 +998,7 @@ static void rna_def_texture_marble(BlenderRNA *brna) prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); - RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); prop= RNA_def_property(srna, "noise_basis_2", PROP_ENUM, PROP_NONE); @@ -1028,14 +1028,14 @@ static void rna_def_texture_magic(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "turbul"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); - RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types"); + RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "noisedepth"); RNA_def_property_range(prop, 0, 30); RNA_def_property_ui_range(prop, 0, 24, 0, 2); - RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation"); + RNA_def_property_ui_text(prop, "Noise Depth", "Depth of the noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); } @@ -1055,8 +1055,8 @@ static void rna_def_texture_blend(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem prop_flip_axis_items[]= { - {0, "HORIZONTAL", 0, "Horizontal", "Flips the texture's X and Y axis"}, - {TEX_FLIPBLEND, "VERTICAL", 0, "Vertical", "Flips the texture's X and Y axis"}, + {0, "HORIZONTAL", 0, "Horizontal", "No flipping"}, + {TEX_FLIPBLEND, "VERTICAL", 0, "Vertical", "Flip the texture's X and Y axis"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "BlendTexture", "Texture"); @@ -1066,13 +1066,13 @@ static void rna_def_texture_blend(BlenderRNA *brna) prop= RNA_def_property(srna, "progression", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_blend_progression); - RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending"); + RNA_def_property_ui_text(prop, "Progression", "Style of the color blending"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); prop= RNA_def_property(srna, "use_flip_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_flip_axis_items); - RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis"); + RNA_def_property_ui_text(prop, "Flip Axis", "Flip the texture's X and Y axis"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); } @@ -1083,9 +1083,9 @@ static void rna_def_texture_stucci(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_stucci_stype[] = { - {TEX_PLASTIC, "PLASTIC", 0, "Plastic", "Uses standard stucci"}, - {TEX_WALLIN, "WALL_IN", 0, "Wall in", "Creates Dimples"}, - {TEX_WALLOUT, "WALL_OUT", 0, "Wall out", "Creates Ridges"}, + {TEX_PLASTIC, "PLASTIC", 0, "Plastic", "Use standard stucci"}, + {TEX_WALLIN, "WALL_IN", 0, "Wall in", "Create Dimples"}, + {TEX_WALLOUT, "WALL_OUT", 0, "Wall out", "Create Ridges"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "StucciTexture", "Texture"); @@ -1096,20 +1096,20 @@ static void rna_def_texture_stucci(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "turbul"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); - RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types"); + RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); - RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noisesize"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); - RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); + RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); @@ -1141,9 +1141,9 @@ static void rna_def_texture_image(BlenderRNA *brna) static EnumPropertyItem prop_image_extension[] = { {TEX_EXTEND, "EXTEND", 0, "Extend", "Extend by repeating edge pixels of the image"}, - {TEX_CLIP, "CLIP", 0, "Clip", "Clip to image size and sets exterior pixels as transparent"}, + {TEX_CLIP, "CLIP", 0, "Clip", "Clip to image size and set exterior pixels as transparent"}, {TEX_CLIPCUBE, "CLIP_CUBE", 0, "Clip Cube", - "Clip to cubic-shaped area around the image and sets exterior pixels as transparent"}, + "Clip to cubic-shaped area around the image and set exterior pixels as transparent"}, {TEX_REPEAT, "REPEAT", 0, "Repeat", "Cause the image to repeat horizontally and vertically"}, {TEX_CHECKER, "CHECKER", 0, "Checker", "Cause the image to repeat in checker board pattern"}, {0, NULL, 0, NULL, NULL}}; @@ -1154,28 +1154,28 @@ static void rna_def_texture_image(BlenderRNA *brna) prop= RNA_def_property(srna, "use_interpolation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_INTERPOL); - RNA_def_property_ui_text(prop, "Interpolation", "Interpolates pixels using selected filter"); + RNA_def_property_ui_text(prop, "Interpolation", "Interpolate pixels using selected filter"); RNA_def_property_update(prop, 0, "rna_Texture_update"); /* XXX: I think flip_axis should be a generic Texture property, enabled for all the texture types */ prop= RNA_def_property(srna, "use_flip_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_IMAROT); - RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis"); + RNA_def_property_ui_text(prop, "Flip Axis", "Flip the texture's X and Y axis"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_USEALPHA); - RNA_def_property_ui_text(prop, "Use Alpha", "Uses the alpha channel information in the image"); + RNA_def_property_ui_text(prop, "Use Alpha", "Use the alpha channel information in the image"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "use_calculate_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_CALCALPHA); - RNA_def_property_ui_text(prop, "Calculate Alpha", "Calculates an alpha channel based on RGB values in the image"); + RNA_def_property_ui_text(prop, "Calculate Alpha", "Calculate an alpha channel based on RGB values in the image"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_NEGALPHA); - RNA_def_property_ui_text(prop, "Invert Alpha", "Inverts all the alpha values in the image"); + RNA_def_property_ui_text(prop, "Invert Alpha", "Invert all the alpha values in the image"); RNA_def_property_update(prop, 0, "rna_Texture_update"); rna_def_filter_common(srna); @@ -1183,46 +1183,46 @@ static void rna_def_texture_image(BlenderRNA *brna) prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "extend"); RNA_def_property_enum_items(prop, prop_image_extension); - RNA_def_property_ui_text(prop, "Extension", "Sets how the image is extrapolated past its original bounds"); + RNA_def_property_ui_text(prop, "Extension", "How the image is extrapolated past its original bounds"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "repeat_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "xrepeat"); RNA_def_property_range(prop, 1, 512); - RNA_def_property_ui_text(prop, "Repeat X", "Sets a repetition multiplier in the X direction"); + RNA_def_property_ui_text(prop, "Repeat X", "Repetition multiplier in the X direction"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "repeat_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "yrepeat"); RNA_def_property_range(prop, 1, 512); - RNA_def_property_ui_text(prop, "Repeat Y", "Sets a repetition multiplier in the Y direction"); + RNA_def_property_ui_text(prop, "Repeat Y", "Repetition multiplier in the Y direction"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_XMIR); - RNA_def_property_ui_text(prop, "Mirror X", "Mirrors the image repetition on the X direction"); + RNA_def_property_ui_text(prop, "Mirror X", "Mirror the image repetition on the X direction"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_YMIR); - RNA_def_property_ui_text(prop, "Mirror Y", "Mirrors the image repetition on the Y direction"); + RNA_def_property_ui_text(prop, "Mirror Y", "Mirror the image repetition on the Y direction"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "use_checker_odd", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_ODD); - RNA_def_property_ui_text(prop, "Checker Odd", "Sets odd checker tiles"); + RNA_def_property_ui_text(prop, "Checker Odd", "Odd checker tiles"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "use_checker_even", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_EVEN); - RNA_def_property_ui_text(prop, "Checker Even", "Sets even checker tiles"); + RNA_def_property_ui_text(prop, "Checker Even", "Even checker tiles"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "checker_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "checkerdist"); RNA_def_property_range(prop, 0.0, 0.99); RNA_def_property_ui_range(prop, 0.0, 0.99, 0.1, 0.01); - RNA_def_property_ui_text(prop, "Checker Distance", "Sets distance between checker tiles"); + RNA_def_property_ui_text(prop, "Checker Distance", "Distance between checker tiles"); RNA_def_property_update(prop, 0, "rna_Texture_update"); #if 0 @@ -1243,28 +1243,28 @@ static void rna_def_texture_image(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "cropxmin"); RNA_def_property_range(prop, -10.0, 10.0); RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); - RNA_def_property_ui_text(prop, "Crop Minimum X", "Sets minimum X value to crop the image"); + RNA_def_property_ui_text(prop, "Crop Minimum X", "Minimum X value to crop the image"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "crop_min_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "cropymin"); RNA_def_property_range(prop, -10.0, 10.0); RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); - RNA_def_property_ui_text(prop, "Crop Minimum Y", "Sets minimum Y value to crop the image"); + RNA_def_property_ui_text(prop, "Crop Minimum Y", "Minimum Y value to crop the image"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "crop_max_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "cropxmax"); RNA_def_property_range(prop, -10.0, 10.0); RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); - RNA_def_property_ui_text(prop, "Crop Maximum X", "Sets maximum X value to crop the image"); + RNA_def_property_ui_text(prop, "Crop Maximum X", "Maximum X value to crop the image"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "crop_max_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "cropymax"); RNA_def_property_range(prop, -10.0, 10.0); RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); - RNA_def_property_ui_text(prop, "Crop Maximum Y", "Sets maximum Y value to crop the image"); + RNA_def_property_ui_text(prop, "Crop Maximum Y", "Maximum Y value to crop the image"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); @@ -1282,13 +1282,13 @@ static void rna_def_texture_image(BlenderRNA *brna) /* Normal Map */ prop= RNA_def_property(srna, "use_normal_map", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP); - RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping"); + RNA_def_property_ui_text(prop, "Normal Map", "Use image RGB values for normal mapping"); RNA_def_property_update(prop, 0, "rna_Texture_update"); /* Derivative Map */ prop= RNA_def_property(srna, "use_derivative_map", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_DERIVATIVEMAP); - RNA_def_property_ui_text(prop, "Derivative Map", "Uses red and green as derivative values"); + RNA_def_property_ui_text(prop, "Derivative Map", "Use red and green as derivative values"); RNA_def_property_update(prop, 0, "rna_Texture_update"); } @@ -1329,7 +1329,7 @@ static void rna_def_texture_environment_map(BlenderRNA *brna) prop= RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "env"); RNA_def_property_struct_type(prop, "EnvironmentMap"); - RNA_def_property_ui_text(prop, "Environment Map", "Gets the environment map associated with this texture"); + RNA_def_property_ui_text(prop, "Environment Map", "Get the environment map associated with this texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); } @@ -1339,15 +1339,13 @@ static void rna_def_texture_musgrave(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_musgrave_type[] = { - {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", - "Fractal noise algorithm. Multifractal: Uses Perlin noise as a basis"}, + {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", "Use Perlin noise as a basis"}, {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", - "Fractal noise algorithm. Ridged Multifractal: Uses Perlin noise with inflection as a basis"}, + "Use Perlin noise with inflection as a basis"}, {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", - "Fractal noise algorithm.Hybrid Multifractal: Uses Perlin noise as a basis, with extended controls"}, - {TEX_FBM, "FBM", 0, "fBM", "Fractal noise algorithm. Fractal Brownian Motion: Uses Brownian noise as a basis"}, - {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", - "Fractal noise algorithm. Hetero Terrain: similar to multifractal"}, + "Use Perlin noise as a basis, with extended controls"}, + {TEX_FBM, "FBM", 0, "fBM", "Fractal Brownian Motion, use Brownian noise as a basis"}, + {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", "Similar to multifractal"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "MusgraveTexture", "Texture"); @@ -1357,7 +1355,7 @@ static void rna_def_texture_musgrave(BlenderRNA *brna) prop= RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_musgrave_type); - RNA_def_property_ui_text(prop, "Type", ""); + RNA_def_property_ui_text(prop, "Type", "Fractal noise algorithm"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "dimension_max", PROP_FLOAT, PROP_NONE); @@ -1393,20 +1391,20 @@ static void rna_def_texture_musgrave(BlenderRNA *brna) prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ns_outscale"); RNA_def_property_range(prop, 0, 10); - RNA_def_property_ui_text(prop, "Noise Intensity", "Scales the intensity of the noise"); + RNA_def_property_ui_text(prop, "Noise Intensity", "Intensity of the noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noisesize"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); - RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); + RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); - RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); @@ -1422,27 +1420,18 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_distance_metric_items[] = { - {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", - "Algorithm used to calculate distance of sample points to feature points; " - "Actual Distance: sqrt(x*x+y*y+z*z)"}, - {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", - "Algorithm used to calculate distance of sample points to feature points; " - "Distance squared: (x*x+y*y+z*z)"}, + {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", "sqrt(x*x+y*y+z*z)"}, + {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", "(x*x+y*y+z*z)"}, {TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan", - "Algorithm used to calculate distance of sample points to feature points; " - "Manhattan: The length of the distance in axial directions"}, + "The length of the distance in axial directions"}, {TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", - "Algorithm used to calculate distance of sample points to feature points; " - "Chebychev: The length of the longest Axial journey"}, + "The length of the longest Axial journey"}, {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", - "Algorithm used to calculate distance of sample points to feature points; " - "Minovsky 1/2: Sets Minkovsky variable to 0.5"}, + "Set Minkovsky variable to 0.5"}, {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4", - "Algorithm used to calculate distance of sample points to feature points; " - "Minkovsky 4: Sets Minkovsky variable to 4"}, + "Set Minkovsky variable to 4"}, {TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", - "Algorithm used to calculate distance of sample points to feature points; " - "Minkovsky: Uses the Minkowsky function to calculate distance " + "Use the Minkowsky function to calculate distance " "(exponent value determines the shape of the boundaries)"}, {0, NULL, 0, NULL, NULL}}; @@ -1450,7 +1439,7 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) /* XXX: OK names / descriptions? */ {TEX_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity"}, {TEX_COL1, "POSITION", 0, "Position", "Color cells by position"}, - {TEX_COL2, "POSITION_OUTLINE", 0, "Position and Outline", "Use position plus an outline based on F2-F.1"}, + {TEX_COL2, "POSITION_OUTLINE", 0, "Position and Outline", "Use position plus an outline based on F2-F1"}, {TEX_COL3, "POSITION_OUTLINE_INTENSITY", 0, "Position, Outline, and Intensity", "Multiply position and outline by intensity"}, {0, NULL, 0, NULL, NULL}}; @@ -1492,7 +1481,7 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) prop= RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "vn_distm"); RNA_def_property_enum_items(prop, prop_distance_metric_items); - RNA_def_property_ui_text(prop, "Distance Metric", ""); + RNA_def_property_ui_text(prop, "Distance Metric", "Algorithm used to calculate distance of sample points to feature points"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE); @@ -1511,7 +1500,7 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "noisesize"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); - RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); + RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); @@ -1540,19 +1529,19 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "noisesize"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); - RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); + RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis2"); RNA_def_property_enum_items(prop, prop_noise_basis_items); - RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); - RNA_def_property_ui_text(prop, "Noise Distortion", "Sets the noise basis for the distortion"); + RNA_def_property_ui_text(prop, "Noise Distortion", "Noise basis for the distortion"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); @@ -1801,7 +1790,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "extend"); RNA_def_property_enum_items(prop, voxeldata_extension); - RNA_def_property_ui_text(prop, "Extension", "Sets how the texture is extrapolated past its original bounds"); + RNA_def_property_ui_text(prop, "Extension", "How the texture is extrapolated past its original bounds"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index 269860e1d7e..eb3512083aa 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -702,7 +702,7 @@ static void rna_def_trackingStabilization(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Scale Influence", "Influence of stabilization algorithm on footage scale"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); - /* use_stabilize_rotation */ + /* use_stabilize_rotation */ prop= RNA_def_property(srna, "use_stabilize_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_STABILIZE_ROTATION); RNA_def_property_ui_text(prop, "Stabilize Rotation", "Stabilize horizon line on the shot"); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index d421aff7157..840498249ea 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -139,12 +139,12 @@ static void rna_def_world_mtex(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem texco_items[] = { - {TEXCO_VIEW, "VIEW", 0, "View", "Uses view vector for the texture coordinates"}, - {TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates (interior mist)"}, - {TEXCO_ANGMAP, "ANGMAP", 0, "AngMap", "Uses 360 degree angular coordinates, e.g. for spherical light probes"}, + {TEXCO_VIEW, "VIEW", 0, "View", "Use view vector for the texture coordinates"}, + {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates (interior mist)"}, + {TEXCO_ANGMAP, "ANGMAP", 0, "AngMap", "Use 360 degree angular coordinates, e.g. for spherical light probes"}, {TEXCO_H_SPHEREMAP, "SPHERE", 0, "Sphere", "For 360 degree panorama sky, spherical mapped, only top half"}, {TEXCO_H_TUBEMAP, "TUBE", 0, "Tube", "For 360 degree panorama sky, cylindrical mapped, only top half"}, - {TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates"}, + {TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "WorldTextureSlot", "TextureSlot"); @@ -381,9 +381,9 @@ static void rna_def_world_mist(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem falloff_items[] = { - {0, "QUADRATIC", 0, "Quadratic", "Mist uses quadratic progression"}, - {1, "LINEAR", 0, "Linear", "Mist uses linear progression"}, - {2, "INVERSE_QUADRATIC", 0, "Inverse Quadratic", "Mist uses inverse quadratic progression"}, + {0, "QUADRATIC", 0, "Quadratic", "Use quadratic progression"}, + {1, "LINEAR", 0, "Linear", "Use linear progression"}, + {2, "INVERSE_QUADRATIC", 0, "Inverse Quadratic", "Use inverse quadratic progression"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "WorldMistSettings", NULL); diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 16de49a8c9d..c632b5beed8 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -447,7 +447,7 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim { int displaymode = 0; int curFrame = framenr - 1 /*scene->r.sfra*/; /* start with 0 at start frame */ - char targetFile[FILE_MAXFILE+FILE_MAXDIR]; + char targetFile[FILE_MAX]; FluidsimSettings *fss = fluidmd->fss; DerivedMesh *dm = NULL; MFace *mface; diff --git a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c index 4a303e911e2..0296fa417d6 100644 --- a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c +++ b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c @@ -49,9 +49,9 @@ static void do_mix_rgb(bNode *node, float *out, float *in1, float *in2, float *f copy_v3_v3(col, in1); if(node->custom2) - ramp_blend(node->custom1, col, col+1, col+2, in2[3]*fac[0], in2); + ramp_blend(node->custom1, col, in2[3]*fac[0], in2); else - ramp_blend(node->custom1, col, col+1, col+2, fac[0], in2); + ramp_blend(node->custom1, col, fac[0], in2); copy_v3_v3(out, col); out[3]= in1[3]; } diff --git a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c index e7350612b5b..4a740a2cfdd 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c @@ -58,7 +58,7 @@ static void node_shader_exec_mix_rgb(void *UNUSED(data), bNode *node, bNodeStack nodestack_get_vec(col, SOCK_VECTOR, in[1]); nodestack_get_vec(vec, SOCK_VECTOR, in[2]); - ramp_blend(node->custom1, col, col+1, col+2, fac, vec); + ramp_blend(node->custom1, col, fac, vec); copy_v3_v3(out[0]->vec, col); } diff --git a/source/blender/nodes/texture/nodes/node_texture_bricks.c b/source/blender/nodes/texture/nodes/node_texture_bricks.c index b4b25a10537..9e76309bce9 100644 --- a/source/blender/nodes/texture/nodes/node_texture_bricks.c +++ b/source/blender/nodes/texture/nodes/node_texture_bricks.c @@ -110,7 +110,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor copy_v4_v4( out, mortar ); } else { copy_v4_v4( out, bricks1 ); - ramp_blend( MA_RAMP_BLEND, out, out+1, out+2, tint, bricks2 ); + ramp_blend( MA_RAMP_BLEND, out, tint, bricks2 ); } } diff --git a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c index 13816088ea7..41115076ec1 100644 --- a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c +++ b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c @@ -56,7 +56,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor CLAMP(fac, 0.0f, 1.0f); copy_v4_v4(out, col1); - ramp_blend(node->custom1, out, out+1, out+2, fac, col2); + ramp_blend(node->custom1, out, fac, col2); } static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c index fac8b02fb85..efc8228c01c 100644 --- a/source/blender/nodes/texture/nodes/node_texture_proc.c +++ b/source/blender/nodes/texture/nodes/node_texture_proc.c @@ -79,7 +79,7 @@ static void do_proc(float *result, TexParams *p, float *col1, float *col2, char } else { copy_v4_v4(result, col1); - ramp_blend(MA_RAMP_BLEND, result, result+1, result+2, texres.tin, col2); + ramp_blend(MA_RAMP_BLEND, result, texres.tin, col2); } } diff --git a/source/blender/nodes/texture/nodes/node_texture_texture.c b/source/blender/nodes/texture/nodes/node_texture_texture.c index 3a0f11d5417..d408b874b84 100644 --- a/source/blender/nodes/texture/nodes/node_texture_texture.c +++ b/source/blender/nodes/texture/nodes/node_texture_texture.c @@ -85,7 +85,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor } else { copy_v4_v4(out, col1); - ramp_blend(MA_RAMP_BLEND, out, out+1, out+2, texres.tin, col2); + ramp_blend(MA_RAMP_BLEND, out, texres.tin, col2); } } } diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 9bb7457a1f7..4a49b9bc1c3 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -203,10 +203,14 @@ static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObj return PyUnicode_DecodeFSDefault(path); } -static PyMethodDef meth_bpy_script_paths= {"script_paths", (PyCFunction)bpy_script_paths, METH_NOARGS, bpy_script_paths_doc}; -static PyMethodDef meth_bpy_blend_paths= {"blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS|METH_KEYWORDS, bpy_blend_paths_doc}; -static PyMethodDef meth_bpy_user_resource= {"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS|METH_KEYWORDS, NULL}; -static PyMethodDef meth_bpy_resource_path= {"resource_path", (PyCFunction)bpy_resource_path, METH_VARARGS|METH_KEYWORDS, bpy_resource_path_doc}; +static PyMethodDef meth_bpy_script_paths= + {"script_paths", (PyCFunction)bpy_script_paths, METH_NOARGS, bpy_script_paths_doc}; +static PyMethodDef meth_bpy_blend_paths= + {"blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS|METH_KEYWORDS, bpy_blend_paths_doc}; +static PyMethodDef meth_bpy_user_resource= + {"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS|METH_KEYWORDS, NULL}; +static PyMethodDef meth_bpy_resource_path= + {"resource_path", (PyCFunction)bpy_resource_path, METH_VARARGS|METH_KEYWORDS, bpy_resource_path_doc}; static PyObject *bpy_import_test(const char *modname) @@ -257,16 +261,21 @@ void BPy_init_modules(void) /* run first, initializes rna types */ BPY_rna_init(); - PyModule_AddObject(mod, "types", BPY_rna_types()); /* needs to be first so bpy_types can run */ - PyModule_AddObject(mod, "StructMetaPropGroup", (PyObject *)&pyrna_struct_meta_idprop_Type); /* metaclass for idprop types, bpy_types.py needs access */ + /* needs to be first so bpy_types can run */ + PyModule_AddObject(mod, "types", BPY_rna_types()); - bpy_lib_init(mod); /* adds '_bpy._library_load', must be called before 'bpy_types' which uses it */ + /* metaclass for idprop types, bpy_types.py needs access */ + PyModule_AddObject(mod, "StructMetaPropGroup", (PyObject *)&pyrna_struct_meta_idprop_Type); + + /* needs to be first so bpy_types can run */ + bpy_lib_init(mod); bpy_import_test("bpy_types"); PyModule_AddObject(mod, "data", BPY_rna_module()); /* imports bpy_types by running this */ bpy_import_test("bpy_types"); - PyModule_AddObject(mod, "props", BPY_rna_props()); - PyModule_AddObject(mod, "ops", BPY_operator_module()); /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ + PyModule_AddObject(mod, "props", BPY_rna_props()); + /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ + PyModule_AddObject(mod, "ops", BPY_operator_module()); PyModule_AddObject(mod, "app", BPY_app_struct()); /* bpy context */ diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index b5ae225fda7..1f99503202a 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -159,6 +159,10 @@ static PyObject *make_app_info(void) /* a few getsets because it makes sense for them to be in bpy.app even though * they are not static */ + +PyDoc_STRVAR(bpy_app_debug_doc, +"Boolean, set when blender is running in debug mode (started with --debug)" +); static PyObject *bpy_app_debug_get(PyObject *UNUSED(self), void *UNUSED(closure)) { return PyBool_FromLong(G.f & G_DEBUG); @@ -179,6 +183,9 @@ static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *UNUS return 0; } +PyDoc_STRVAR(bpy_app_debug_value_doc, +"Int, number which can be set to non-zero values for testing purposes" +); static PyObject *bpy_app_debug_value_get(PyObject *UNUSED(self), void *UNUSED(closure)) { return PyLong_FromSsize_t(G.rt); @@ -198,11 +205,17 @@ static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void return 0; } +PyDoc_STRVAR(bpy_app_tempdir_doc, +"String, the temp directory used by blender (read-only)" +); static PyObject *bpy_app_tempdir_get(PyObject *UNUSED(self), void *UNUSED(closure)) { return PyC_UnicodeFromByte(BLI_temporary_dir()); } +PyDoc_STRVAR(bpy_app_driver_dict_doc, +"Dictionary for drivers namespace, editable in-place, reset on file load (read-only)" +); static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(closure)) { if (bpy_pydriver_Dict == NULL) @@ -217,10 +230,10 @@ static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(cl static PyGetSetDef bpy_app_getsets[]= { - {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)"Boolean, set when blender is running in debug mode (started with -d)", NULL}, - {(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)"Int, number which can be set to non-zero values for testing purposes.", NULL}, - {(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)"String, the temp directory used by blender (read-only)", NULL}, - {(char *)"driver_namespace", bpy_app_driver_dict_get, NULL, (char *)"Dictionary for drivers namespace, editable in-place, reset on file load (read-only)", NULL}, + {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, NULL}, + {(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL}, + {(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)bpy_app_tempdir_doc, NULL}, + {(char *)"driver_namespace", bpy_app_driver_dict_get, NULL, (char *)bpy_app_driver_dict_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} }; @@ -253,4 +266,3 @@ PyObject *BPY_app_struct(void) return ret; } - diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 7dee2ce6fb4..66db0724d96 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -134,9 +134,12 @@ void bpy_context_clear(bContext *UNUSED(C), PyGILState_STATE *gilstate) fprintf(stderr, "ERROR: Python context internal state bug. this should not happen!\n"); } else if (py_call_level==0) { - // XXX - Calling classes currently wont store the context :\, cant set NULL because of this. but this is very flakey still. - //BPy_SetContext(NULL); - //bpy_import_main_set(NULL); + /* XXX - Calling classes currently wont store the context :\, + * cant set NULL because of this. but this is very flakey still. */ +#if 0 + BPy_SetContext(NULL); + bpy_import_main_set(NULL); +#endif #ifdef TIME_PY_RUN bpy_timer_run_tot += PIL_check_seconds_timer() - bpy_timer_run; @@ -200,7 +203,7 @@ void BPY_python_start(int argc, const char **argv) PyThreadState *py_tstate= NULL; /* not essential but nice to set our name */ - static wchar_t program_path_wchar[FILE_MAXDIR+FILE_MAXFILE]; /* python holds a reference */ + static wchar_t program_path_wchar[FILE_MAX]; /* python holds a reference */ BLI_strncpy_wchar_from_utf8(program_path_wchar, BLI_program_path(), sizeof(program_path_wchar) / sizeof(wchar_t)); Py_SetProgramName(program_path_wchar); @@ -329,7 +332,8 @@ typedef struct { } PyModuleObject; #endif -static int python_script_exec(bContext *C, const char *fn, struct Text *text, struct ReportList *reports, const short do_jump) +static int python_script_exec(bContext *C, const char *fn, struct Text *text, + struct ReportList *reports, const short do_jump) { PyObject *main_mod= NULL; PyObject *py_dict= NULL, *py_result= NULL; @@ -717,7 +721,10 @@ void bpy_module_delay_init(PyObject *bpy_proxy) { const int argc= 1; const char *argv[2]; - PyObject *filename_obj= PyModule_GetFilenameObject(bpy_proxy); /* updating the module dict below will loose the reference to __file__ */ + + /* updating the module dict below will loose the reference to __file__ */ + PyObject *filename_obj= PyModule_GetFilenameObject(bpy_proxy); + const char *filename_rel= _PyUnicode_AsString(filename_obj); /* can be relative */ char filename_abs[1024]; diff --git a/source/blender/python/intern/bpy_library.c b/source/blender/python/intern/bpy_library.c index b91948cc0b8..d7c7a1e846f 100644 --- a/source/blender/python/intern/bpy_library.c +++ b/source/blender/python/intern/bpy_library.c @@ -426,7 +426,10 @@ static PyObject *bpy_lib_dir(BPy_Library *self) int bpy_lib_init(PyObject *mod_par) { - static PyMethodDef load_meth= {"load", (PyCFunction)bpy_lib_load, METH_STATIC|METH_VARARGS|METH_KEYWORDS, bpy_lib_load_doc}; + static PyMethodDef load_meth= {"load", (PyCFunction)bpy_lib_load, + METH_STATIC|METH_VARARGS|METH_KEYWORDS, + bpy_lib_load_doc}; + PyModule_AddObject(mod_par, "_library_load", PyCFunction_New(&load_meth, NULL)); /* some compilers dont like accessing this directly, delay assignment */ diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 3fd4e8a128b..70346a65bf9 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -31,11 +31,6 @@ * which fakes exposing operators as modules/functions using its own classes. */ - -/* Note, this module is not to be used directly by the user. - * Internally its exposed as '_bpy.ops', which provides functions for 'bpy.ops', a python package. - * */ - #include #include "RNA_types.h" @@ -78,7 +73,8 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args) int context= WM_OP_EXEC_DEFAULT; - // XXX Todo, work out a better solution for passing on context, could make a tuple from self and pack the name and Context into it... + /* XXX Todo, work out a better solution for passing on context, + * could make a tuple from self and pack the name and Context into it... */ bContext *C= (bContext *)BPy_GetContext(); if (C==NULL) { @@ -152,7 +148,8 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) /* note that context is an int, python does the conversion in this case */ int context= WM_OP_EXEC_DEFAULT; - // XXX Todo, work out a better solution for passing on context, could make a tuple from self and pack the name and Context into it... + /* XXX Todo, work out a better solution for passing on context, + * could make a tuple from self and pack the name and Context into it... */ bContext *C= (bContext *)BPy_GetContext(); if (C==NULL) { diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 950aa9458d5..39ad80169d2 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -301,7 +301,7 @@ static int py_long_as_int(PyObject *py_long, int *r_int) if (srna==NULL) { \ if (PyErr_Occurred()) \ return NULL; \ - return bpy_prop_deferred_return((void *)pymeth_##_func, kw); \ + return bpy_prop_deferred_return(pymeth_##_func, kw); \ } \ /* terse macros for error checks shared between all funcs cant use function @@ -370,7 +370,8 @@ static int bpy_struct_id_used(StructRNA *srna, char *identifier) #endif -/* Function that sets RNA, NOTE - self is NULL when called from python, but being abused from C so we can pass the srna along +/* Function that sets RNA, NOTE - self is NULL when called from python, + * but being abused from C so we can pass the srna along. * This isnt incorrect since its a python object - but be careful */ PyDoc_STRVAR(BPy_BoolProperty_doc, ".. function:: BoolProperty(name=\"\", description=\"\", default=False, options={'ANIMATABLE'}, subtype='NONE', update=None)\n" @@ -392,7 +393,8 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(BoolProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "options", "subtype", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "options", "subtype", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; int def=0; @@ -459,7 +461,8 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_HEAD(BoolVectorProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "options", "subtype", "size", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "options", "subtype", "size", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; int def[PYRNA_STACK_ARRAY]={0}; @@ -485,7 +488,9 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_SUBTYPE_CHECK(BoolVectorProperty, property_flag_items, property_subtype_array_items) if (size < 1 || size > PYRNA_STACK_ARRAY) { - PyErr_Format(PyExc_TypeError, "BoolVectorProperty(size=%d): size must be between 0 and " STRINGIFY(PYRNA_STACK_ARRAY), size); + PyErr_Format(PyExc_TypeError, + "BoolVectorProperty(size=%d): size must be between 0 and " + STRINGIFY(PYRNA_STACK_ARRAY), size); return NULL; } @@ -534,7 +539,8 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(IntProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "min", "max", "soft_min", "soft_max", "step", "options", "subtype", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def=0; @@ -603,7 +609,9 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_HEAD(IntVectorProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", "size", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "min", "max", "soft_min", "soft_max", + "step", "options", "subtype", "size", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def[PYRNA_STACK_ARRAY]={0}; @@ -631,7 +639,9 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_SUBTYPE_CHECK(IntVectorProperty, property_flag_items, property_subtype_array_items) if (size < 1 || size > PYRNA_STACK_ARRAY) { - PyErr_Format(PyExc_TypeError, "IntVectorProperty(size=%d): size must be between 0 and " STRINGIFY(PYRNA_STACK_ARRAY), size); + PyErr_Format(PyExc_TypeError, + "IntVectorProperty(size=%d): size must be between 0 and " + STRINGIFY(PYRNA_STACK_ARRAY), size); return NULL; } @@ -682,7 +692,9 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(FloatProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "unit", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "min", "max", "soft_min", "soft_max", + "step", "precision", "options", "subtype", "unit", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def=0.0f; @@ -761,7 +773,9 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec BPY_PROPDEF_HEAD(FloatVectorProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "unit", "size", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "min", "max", "soft_min", "soft_max", + "step", "precision", "options", "subtype", "unit", "size", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def[PYRNA_STACK_ARRAY]={0.0f}; @@ -796,7 +810,9 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec } if (size < 1 || size > PYRNA_STACK_ARRAY) { - PyErr_Format(PyExc_TypeError, "FloatVectorProperty(size=%d): size must be between 0 and " STRINGIFY(PYRNA_STACK_ARRAY), size); + PyErr_Format(PyExc_TypeError, + "FloatVectorProperty(size=%d): size must be between 0 and " + STRINGIFY(PYRNA_STACK_ARRAY), size); return NULL; } @@ -845,7 +861,8 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw BPY_PROPDEF_HEAD(StringProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "maxlen", "options", "subtype", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "maxlen", "options", "subtype", "update", NULL}; const char *id=NULL, *name="", *description="", *def=""; int id_len; int maxlen=0; @@ -913,7 +930,10 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i if (is_enum_flag) { if (seq_len > RNA_ENUM_BITFLAG_SIZE) { - PyErr_SetString(PyExc_TypeError, "EnumProperty(...): maximum " STRINGIFY(RNA_ENUM_BITFLAG_SIZE) " members for a ENUM_FLAG type property"); + PyErr_SetString(PyExc_TypeError, + "EnumProperty(...): maximum " + STRINGIFY(RNA_ENUM_BITFLAG_SIZE) + " members for a ENUM_FLAG type property"); return NULL; } if (def && !PySet_Check(def)) { @@ -1026,7 +1046,8 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i * immediately after use, so we need to duplicate them, ugh. * annoying because it works most of the time without this. */ { - EnumPropertyItem *items_dup= MEM_mallocN((sizeof(EnumPropertyItem) * (seq_len + 1)) + (sizeof(char) * totbuf), "enum_items_from_py2"); + EnumPropertyItem *items_dup= MEM_mallocN((sizeof(EnumPropertyItem) * (seq_len + 1)) + (sizeof(char) * totbuf), + "enum_items_from_py2"); EnumPropertyItem *items_ptr= items_dup; char *buf= ((char *)items_dup) + (sizeof(EnumPropertyItem) * (seq_len + 1)); memcpy(items_dup, items, sizeof(EnumPropertyItem) * (seq_len + 1)); @@ -1077,7 +1098,9 @@ static EnumPropertyItem *bpy_props_enum_itemf(struct bContext *C, PointerRNA *pt PyObject *items_fast; int defvalue_dummy=0; - if (!(items_fast= PySequence_Fast(items, "EnumProperty(...): return value from the callback was not a sequence"))) { + if (!(items_fast= PySequence_Fast(items, "EnumProperty(...): " + "return value from the callback was not a sequence"))) + { err= -1; } else { @@ -1137,7 +1160,8 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(EnumProperty) if (srna) { - static const char *kwlist[]= {"attr", "items", "name", "description", "default", "options", "update", NULL}; + static const char *kwlist[]= {"attr", "items", "name", "description", "default", + "options", "update", NULL}; const char *id=NULL, *name="", *description=""; PyObject *def= NULL; int id_len; @@ -1187,7 +1211,9 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) eitems= DummyRNA_NULL_items; } else { - if (!(items_fast= PySequence_Fast(items, "EnumProperty(...): expected a sequence of tuples for the enum items or a function"))) { + if (!(items_fast= PySequence_Fast(items, "EnumProperty(...): " + "expected a sequence of tuples for the enum items or a function"))) + { return NULL; } @@ -1206,7 +1232,10 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) if (is_itemf) { RNA_def_enum_funcs(prop, bpy_props_enum_itemf); RNA_def_enum_py_data(prop, (void *)items); - /* Py_INCREF(items); */ /* watch out!, if user is tricky they can probably crash blender if they manage to free the callback, take care! */ + + /* watch out!, if a user is tricky they can probably crash blender + * if they manage to free the callback, take care! */ + /* Py_INCREF(items); */ } if (pyopts) { diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index eb7362ff8c7..d15330ecb05 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -367,7 +367,8 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item #ifdef USE_MATHUTILS #include "../mathutils/mathutils.h" /* so we can have mathutils callbacks */ -static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, Py_ssize_t start, Py_ssize_t stop, Py_ssize_t length); +static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, + Py_ssize_t start, Py_ssize_t stop, Py_ssize_t length); static short pyrna_rotation_euler_order_get(PointerRNA *ptr, PropertyRNA **prop_eul_order, short order_fallback); /* bpyrna vector/euler/quat callbacks */ @@ -589,7 +590,15 @@ static short pyrna_rotation_euler_order_get(PointerRNA *ptr, PropertyRNA **prop_ /* note that PROP_NONE is included as a vector subtype. this is because its handy to * have x/y access to fcurve keyframes and other fixed size float arrays of length 2-4. */ -#define PROP_ALL_VECTOR_SUBTYPES PROP_COORDS: case PROP_TRANSLATION: case PROP_DIRECTION: case PROP_VELOCITY: case PROP_ACCELERATION: case PROP_XYZ: case PROP_XYZ_LENGTH +#define PROP_ALL_VECTOR_SUBTYPES \ + PROP_COORDS: \ + case PROP_TRANSLATION: \ + case PROP_DIRECTION: \ + case PROP_VELOCITY: \ + case PROP_ACCELERATION: \ + case PROP_XYZ: \ + case PROP_XYZ_LENGTH \ + PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop) { @@ -2099,7 +2108,8 @@ static PyObject *pyrna_prop_collection_subscript_str(BPy_PropertyRNA *self, cons /* special case: bpy.data.objects["some_id_name", "//some_lib_name.blend"] * also for: bpy.data.objects.get(("some_id_name", "//some_lib_name.blend"), fallback) */ -static PyObject *pyrna_prop_collection_subscript_str_lib_pair(BPy_PropertyRNA *self, PyObject *key, const char *err_prefix, const short err_not_found) +static PyObject *pyrna_prop_collection_subscript_str_lib_pair(BPy_PropertyRNA *self, PyObject *key, + const char *err_prefix, const short err_not_found) { char *keyname; @@ -2188,7 +2198,10 @@ static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py list= PyList_New(0); /* first loop up-until the start */ - for (RNA_property_collection_begin(&self->ptr, self->prop, &rna_macro_iter); rna_macro_iter.valid; RNA_property_collection_next(&rna_macro_iter)) { + for (RNA_property_collection_begin(&self->ptr, self->prop, &rna_macro_iter); + rna_macro_iter.valid; + RNA_property_collection_next(&rna_macro_iter)) + { /* PointerRNA itemptr= rna_macro_iter.ptr; */ if (count == start) { break; @@ -2197,7 +2210,9 @@ static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py } /* add items until stop */ - for (; rna_macro_iter.valid; RNA_property_collection_next(&rna_macro_iter)) { + for (; rna_macro_iter.valid; + RNA_property_collection_next(&rna_macro_iter)) + { item= pyrna_struct_CreatePyObject(&rna_macro_iter.ptr); PyList_Append(list, item); Py_DECREF(item); @@ -2217,7 +2232,8 @@ static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py * note: could also use pyrna_prop_array_to_py_index(self, count) in a loop but its a lot slower * since at the moment it reads (and even allocates) the entire array for each index. */ -static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, Py_ssize_t start, Py_ssize_t stop, Py_ssize_t length) +static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, + Py_ssize_t start, Py_ssize_t stop, Py_ssize_t length) { int count, totdim; PyObject *tuple; @@ -2347,7 +2363,8 @@ static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject } else if (PyTuple_Check(key)) { /* special case, for ID datablocks we */ - return pyrna_prop_collection_subscript_str_lib_pair(self, key, "bpy_prop_collection[id, lib]", TRUE); + return pyrna_prop_collection_subscript_str_lib_pair(self, key, + "bpy_prop_collection[id, lib]", TRUE); } else { PyErr_Format(PyExc_TypeError, @@ -2532,7 +2549,8 @@ static PyObject *pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject } /* could call (pyrna_py_to_prop_array_index(self, i, value) in a loop but it is slow */ -static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop, int start, int stop, int length, PyObject *value_orig) +static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop, + int start, int stop, int length, PyObject *value_orig) { PyObject *value; int count; @@ -2540,7 +2558,8 @@ static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop, in int ret= 0; if (value_orig == NULL) { - PyErr_SetString(PyExc_TypeError, "bpy_prop_array[slice]= value: deleting with list types is not supported by bpy_struct"); + PyErr_SetString(PyExc_TypeError, + "bpy_prop_array[slice]= value: deleting with list types is not supported by bpy_struct"); return -1; } @@ -2550,7 +2569,8 @@ static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop, in if (PySequence_Fast_GET_SIZE(value) != stop-start) { Py_DECREF(value); - PyErr_SetString(PyExc_TypeError, "bpy_prop_array[slice]= value: resizing bpy_struct arrays isn't supported"); + PyErr_SetString(PyExc_TypeError, + "bpy_prop_array[slice]= value: resizing bpy_struct arrays isn't supported"); return -1; } @@ -3459,9 +3479,12 @@ static int pyrna_struct_pydict_contains(PyObject *self, PyObject *pyname) #endif //--------------- setattr------------------------------------------- -static int pyrna_is_deferred_prop(PyObject *value) +static int pyrna_is_deferred_prop(const PyObject *value) { - return PyTuple_CheckExact(value) && PyTuple_GET_SIZE(value)==2 && PyCallable_Check(PyTuple_GET_ITEM(value, 0)) && PyDict_CheckExact(PyTuple_GET_ITEM(value, 1)); + return PyTuple_CheckExact(value) && + PyTuple_GET_SIZE(value) == 2 && + PyCFunction_Check(PyTuple_GET_ITEM(value, 0)) && + PyDict_CheckExact(PyTuple_GET_ITEM(value, 1)); } #if 0 @@ -3499,8 +3522,9 @@ static int pyrna_struct_meta_idprop_setattro(PyObject *cls, PyObject *attr, PyOb { StructRNA *srna= srna_from_self(cls, "StructRNA.__setattr__"); const int is_deferred_prop= (value && pyrna_is_deferred_prop(value)); + const char *attr_str= _PyUnicode_AsString(attr); - if (srna && !pyrna_write_check() && (is_deferred_prop || RNA_struct_type_find_property(srna, _PyUnicode_AsString(attr)))) { + if (srna && !pyrna_write_check() && (is_deferred_prop || RNA_struct_type_find_property(srna, attr_str))) { PyErr_Format(PyExc_AttributeError, "pyrna_struct_meta_idprop_setattro() " "can't set in readonly state '%.200s.%S'", @@ -3538,14 +3562,12 @@ static int pyrna_struct_meta_idprop_setattro(PyObject *cls, PyObject *attr, PyOb } else { /* remove existing property if its set or we also end up with confusion */ - const char *attr_str= _PyUnicode_AsString(attr); RNA_def_property_free_identifier(srna, attr_str); /* ignore on failure */ } } else { /* __delattr__ */ /* first find if this is a registered property */ - const char *attr_str= _PyUnicode_AsString(attr); - int ret= RNA_def_property_free_identifier(srna, attr_str); + const int ret= RNA_def_property_free_identifier(srna, attr_str); if (ret == -1) { PyErr_Format(PyExc_TypeError, "struct_meta_idprop.detattr(): '%s' not a dynamic property", @@ -3801,6 +3823,10 @@ static PyObject *pyrna_prop_collection_idprop_move(BPy_PropertyRNA *self, PyObje Py_RETURN_NONE; } + +PyDoc_STRVAR(pyrna_struct_get_id_data_doc, +"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)" +); static PyObject *pyrna_struct_get_id_data(BPy_DummyPointerRNA *self) { /* used for struct and pointer since both have a ptr */ @@ -3813,11 +3839,17 @@ static PyObject *pyrna_struct_get_id_data(BPy_DummyPointerRNA *self) Py_RETURN_NONE; } +PyDoc_STRVAR(pyrna_struct_get_data_doc, +"The data this property is using, *type* :class:`bpy.types.bpy_struct`" +); static PyObject *pyrna_struct_get_data(BPy_DummyPointerRNA *self) { return pyrna_struct_CreatePyObject(&self->ptr); } +PyDoc_STRVAR(pyrna_struct_get_rna_type_doc, +"The property type for introspection" +); static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self) { PointerRNA tptr; @@ -3832,18 +3864,18 @@ static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self) /*****************************************************************************/ static PyGetSetDef pyrna_prop_getseters[]= { - {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL}, - {(char *)"data", (getter)pyrna_struct_get_data, (setter)NULL, (char *)"The data this property is using, *type* :class:`bpy.types.bpy_struct`", NULL}, - {(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)"The property type for introspection", NULL}, + {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)pyrna_struct_get_id_data_doc, NULL}, + {(char *)"data", (getter)pyrna_struct_get_data, (setter)NULL, (char *)pyrna_struct_get_data_doc, NULL}, + {(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)pyrna_struct_get_rna_type_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; - static PyGetSetDef pyrna_struct_getseters[]= { - {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL}, + {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)pyrna_struct_get_id_data_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; + PyDoc_STRVAR(pyrna_prop_collection_keys_doc, ".. method:: keys()\n" "\n" @@ -3908,7 +3940,8 @@ static PyObject *pyrna_prop_collection_items(BPy_PropertyRNA *self) MEM_freeN(nameptr); } else { - PyTuple_SET_ITEM(item, 0, PyLong_FromSsize_t(i)); /* a bit strange but better then returning an empty list */ + /* a bit strange but better then returning an empty list */ + PyTuple_SET_ITEM(item, 0, PyLong_FromSsize_t(i)); } PyTuple_SET_ITEM(item, 1, pyrna_struct_CreatePyObject(&itemptr)); @@ -4030,7 +4063,8 @@ static PyObject *pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args return pyrna_struct_CreatePyObject(&newptr); } else if (PyTuple_Check(key_ob)) { - PyObject *ret= pyrna_prop_collection_subscript_str_lib_pair(self, key_ob, "bpy_prop_collection.get((id, lib))", FALSE); + PyObject *ret= pyrna_prop_collection_subscript_str_lib_pair(self, key_ob, + "bpy_prop_collection.get((id, lib))", FALSE); if (ret) { return ret; } @@ -4066,10 +4100,12 @@ static void foreach_attr_type( BPy_PropertyRNA *self, const char *attr, /* pyrna_prop_collection_foreach_get/set both use this */ static int foreach_parse_args( - BPy_PropertyRNA *self, PyObject *args, + BPy_PropertyRNA *self, PyObject *args, /*values to assign */ - const char **attr, PyObject **seq, int *tot, int *size, RawPropertyType *raw_type, int *attr_tot, int *attr_signed) + const char **attr, PyObject **seq, int *tot, int *size, + RawPropertyType *raw_type, int *attr_tot, int *attr_signed + ) { #if 0 int array_tot; @@ -4748,7 +4784,8 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject const char *fn; int lineno; PyC_FileAndNum(&fn, &lineno); - printf("pyrna_func_call > %.200s.%.200s : %.200s:%d\n", RNA_struct_identifier(self_ptr->type), RNA_function_identifier(self_func), fn, lineno); + printf("pyrna_func_call > %.200s.%.200s : %.200s:%d\n", + RNA_struct_identifier(self_ptr->type), RNA_function_identifier(self_func), fn, lineno); } */ @@ -5899,7 +5936,9 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna) // if (!descr) descr= "(no docs)"; // "__doc__", descr - if (RNA_struct_idprops_check(srna) && !PyObject_IsSubclass(py_base, (PyObject *)&pyrna_struct_meta_idprop_Type)) { + if ( RNA_struct_idprops_check(srna) && + !PyObject_IsSubclass(py_base, (PyObject *)&pyrna_struct_meta_idprop_Type)) + { metaclass= (PyObject *)&pyrna_struct_meta_idprop_Type; } else { @@ -5907,7 +5946,8 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna) } /* always use O not N when calling, N causes refcount errors */ - newclass= PyObject_CallFunction(metaclass, (char *)"s(O){sss()}", idname, py_base, "__module__","bpy.types", "__slots__"); + newclass= PyObject_CallFunction(metaclass, (char *)"s(O){sss()}", + idname, py_base, "__module__","bpy.types", "__slots__"); /* newclass will now have 2 ref's, ???, probably 1 is internal since decrefing here segfaults */ @@ -6376,10 +6416,14 @@ static int pyrna_deferred_register_props(StructRNA *srna, PyObject *class_dict) if ((order= PyDict_GetItem(class_dict, bpy_intern_str_order)) && PyList_CheckExact(order)) { for (pos= 0; posco_argcount; /* note, the number of args we check for and the number of args we give to - * @classmethods are different (quirk of python), this is why rna_function_arg_count() doesn't return the value -1*/ + * @classmethods are different (quirk of python), + * this is why rna_function_arg_count() doesn't return the value -1*/ if (flag & FUNC_NO_SELF) func_arg_count++; @@ -6866,7 +6911,9 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param /* only useful for single argument returns, we'll need another list loop for multiple */ if (flag & PROP_OUTPUT) { - err= pyrna_py_to_prop(&funcptr, parm, iter.data, PyTuple_GET_ITEM(ret, i++), "calling class function:"); + err= pyrna_py_to_prop(&funcptr, parm, iter.data, + PyTuple_GET_ITEM(ret, i++), + "calling class function:"); if (err) { break; } @@ -7065,7 +7112,8 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class identifier= ((PyTypeObject*)py_class)->tp_name; - srna_new= reg(CTX_data_main(C), &reports, py_class, identifier, bpy_class_validate, bpy_class_call, bpy_class_free); + srna_new= reg(CTX_data_main(C), &reports, py_class, identifier, + bpy_class_validate, bpy_class_call, bpy_class_free); if (BPy_reports_to_error(&reports, PyExc_RuntimeError, TRUE) == -1) return NULL; @@ -7163,7 +7211,9 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla unreg= RNA_struct_unregister(srna); if (!unreg) { - PyErr_SetString(PyExc_ValueError, "unregister_class(...): expected a Type subclassed from a registerable rna type (no unregister supported)"); + PyErr_SetString(PyExc_ValueError, + "unregister_class(...): " + "expected a Type subclassed from a registerable rna type (no unregister supported)"); return NULL; } diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index edc6e672238..8f88814b3e4 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -55,8 +55,9 @@ #define FALSE 0 /* for keyframes and drivers */ -static int pyrna_struct_anim_args_parse(PointerRNA *ptr, const char *error_prefix, const char *path, - const char **path_full, int *index) +static int pyrna_struct_anim_args_parse( + PointerRNA *ptr, const char *error_prefix, const char *path, + const char **path_full, int *index) { const int is_idbase= RNA_struct_is_ID(ptr->type); PropertyRNA *prop; @@ -146,8 +147,9 @@ static int pyrna_struct_anim_args_parse(PointerRNA *ptr, const char *error_prefi } /* internal use for insert and delete */ -static int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix, - const char **path_full, int *index, float *cfra, const char **group_name) /* return values */ +static int pyrna_struct_keyframe_parse( + PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix, + const char **path_full, int *index, float *cfra, const char **group_name) /* return values */ { static const char *kwlist[]= {"data_path", "index", "frame", "group", NULL}; const char *path; diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index 73e9e0a44d9..1d1cab1c66d 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -176,7 +176,8 @@ static int count_items(PyObject *seq, int dim) } /* Modifies property array length if needed and PROP_DYNAMIC flag is set. */ -static int validate_array_length(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, int *totitem, const char *error_prefix) +static int validate_array_length(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, + int lvalue_dim, int *totitem, const char *error_prefix) { int dimsize[MAX_ARRAY_DIMENSION]; int tot, totdim, len; @@ -249,7 +250,9 @@ static int validate_array_length(PyObject *rvalue, PointerRNA *ptr, PropertyRNA return 0; } -static int validate_array(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, ItemTypeCheckFunc check_item_type, const char *item_type_str, int *totitem, const char *error_prefix) +static int validate_array(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, + int lvalue_dim, ItemTypeCheckFunc check_item_type, const char *item_type_str, int *totitem, + const char *error_prefix) { int dimsize[MAX_ARRAY_DIMENSION]; int totdim= RNA_property_array_dimension(ptr, prop, dimsize); @@ -262,7 +265,9 @@ static int validate_array(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, return validate_array_length(rvalue, ptr, prop, lvalue_dim, totitem, error_prefix); } -static char *copy_value_single(PyObject *item, PointerRNA *ptr, PropertyRNA *prop, char *data, unsigned int item_size, int *index, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index) +static char *copy_value_single(PyObject *item, PointerRNA *ptr, PropertyRNA *prop, + char *data, unsigned int item_size, int *index, + ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index) { if (!data) { char value[sizeof(int)]; @@ -279,7 +284,9 @@ static char *copy_value_single(PyObject *item, PointerRNA *ptr, PropertyRNA *pro return data; } -static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int dim, char *data, unsigned int item_size, int *index, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index) +static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, + int dim, char *data, unsigned int item_size, int *index, + ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index) { int totdim= RNA_property_array_dimension(ptr, prop, NULL); const Py_ssize_t seq_size= PySequence_Size(seq); @@ -320,7 +327,9 @@ static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int return data; } -static int py_to_array(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix) +static int py_to_array(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, + char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, + ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix) { /*int totdim, dim_size[MAX_ARRAY_DIMENSION];*/ int totitem; @@ -372,7 +381,10 @@ static int py_to_array(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, char * return 0; } -static int py_to_array_index(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, int arrayoffset, int index, ItemTypeCheckFunc check_item_type, const char *item_type_str, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index, const char *error_prefix) +static int py_to_array_index(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, + int lvalue_dim, int arrayoffset, int index, + ItemTypeCheckFunc check_item_type, const char *item_type_str, + ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index, const char *error_prefix) { int totdim, dimsize[MAX_ARRAY_DIMENSION]; int totitem, i; @@ -465,18 +477,22 @@ static void bool_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, void * RNA_property_boolean_set_index(ptr, prop, index, *(int*)value); } -int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyObject *py, const char *error_prefix) +int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, + PyObject *py, const char *error_prefix) { int ret; switch (RNA_property_type(prop)) { case PROP_FLOAT: - ret= py_to_array(py, ptr, prop, param_data, py_float_check, "float", sizeof(float), py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array, error_prefix); + ret= py_to_array(py, ptr, prop, param_data, py_float_check, "float", sizeof(float), + py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array, error_prefix); break; case PROP_INT: - ret= py_to_array(py, ptr, prop, param_data, py_int_check, "int", sizeof(int), py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array, error_prefix); + ret= py_to_array(py, ptr, prop, param_data, py_int_check, "int", sizeof(int), + py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array, error_prefix); break; case PROP_BOOLEAN: - ret= py_to_array(py, ptr, prop, param_data, py_bool_check, "boolean", sizeof(int), py_to_bool, (RNA_SetArrayFunc)RNA_property_boolean_set_array, error_prefix); + ret= py_to_array(py, ptr, prop, param_data, py_bool_check, "boolean", sizeof(int), + py_to_bool, (RNA_SetArrayFunc)RNA_property_boolean_set_array, error_prefix); break; default: PyErr_SetString(PyExc_TypeError, "not an array type"); @@ -486,18 +502,22 @@ int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyOb return ret; } -int pyrna_py_to_array_index(PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int index, PyObject *py, const char *error_prefix) +int pyrna_py_to_array_index(PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int index, + PyObject *py, const char *error_prefix) { int ret; switch (RNA_property_type(prop)) { case PROP_FLOAT: - ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, py_float_check, "float", py_to_float, float_set_index, error_prefix); + ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, + py_float_check, "float", py_to_float, float_set_index, error_prefix); break; case PROP_INT: - ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, py_int_check, "int", py_to_int, int_set_index, error_prefix); + ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, + py_int_check, "int", py_to_int, int_set_index, error_prefix); break; case PROP_BOOLEAN: - ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, py_bool_check, "boolean", py_to_bool, bool_set_index, error_prefix); + ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, + py_bool_check, "boolean", py_to_bool, bool_set_index, error_prefix); break; default: PyErr_SetString(PyExc_TypeError, "not an array type"); diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c index 5045f6708b5..599c4312985 100644 --- a/source/blender/python/intern/bpy_traceback.c +++ b/source/blender/python/intern/bpy_traceback.c @@ -146,7 +146,10 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset) PyErr_Restore(exception, value, (PyObject *)tb); /* takes away reference! */ PyErr_Print(); - for (tb= (PyTracebackObject *)PySys_GetObject("last_traceback"); tb && (PyObject *)tb != Py_None; tb= tb->tb_next) { + for (tb= (PyTracebackObject *)PySys_GetObject("last_traceback"); + tb && (PyObject *)tb != Py_None; + tb= tb->tb_next) + { PyObject *coerce; const char *tb_filepath= traceback_filepath(tb, &coerce); const int match= strcmp(tb_filepath, filepath) != 0; diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index a78cc3e2288..b62484a6995 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -587,7 +587,7 @@ void shadeSunView(float col_r[3], const float view[3]) xyz_to_rgb(colorxyz[0], colorxyz[1], colorxyz[2], &sun_collector[0], &sun_collector[1], &sun_collector[2], lar->sunsky->sky_colorspace); - ramp_blend(lar->sunsky->skyblendtype, col_r, col_r+1, col_r+2, lar->sunsky->skyblendfac, sun_collector); + ramp_blend(lar->sunsky->skyblendtype, col_r, lar->sunsky->skyblendfac, sun_collector); } } } diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index ff381ab6d13..4ab5f1a61c2 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -1484,32 +1484,32 @@ void texture_rgb_blend(float in[3], const float tex[3], const float out[3], floa case MTEX_BLEND_HUE: fact*= facg; copy_v3_v3(in, out); - ramp_blend(MA_RAMP_HUE, in, in+1, in+2, fact, tex); + ramp_blend(MA_RAMP_HUE, in, fact, tex); break; case MTEX_BLEND_SAT: fact*= facg; copy_v3_v3(in, out); - ramp_blend(MA_RAMP_SAT, in, in+1, in+2, fact, tex); + ramp_blend(MA_RAMP_SAT, in, fact, tex); break; case MTEX_BLEND_VAL: fact*= facg; copy_v3_v3(in, out); - ramp_blend(MA_RAMP_VAL, in, in+1, in+2, fact, tex); + ramp_blend(MA_RAMP_VAL, in, fact, tex); break; case MTEX_BLEND_COLOR: fact*= facg; copy_v3_v3(in, out); - ramp_blend(MA_RAMP_COLOR, in, in+1, in+2, fact, tex); + ramp_blend(MA_RAMP_COLOR, in, fact, tex); break; case MTEX_SOFT_LIGHT: fact*= facg; copy_v3_v3(in, out); - ramp_blend(MA_RAMP_SOFT, in, in+1, in+2, fact, tex); + ramp_blend(MA_RAMP_SOFT, in, fact, tex); break; case MTEX_LIN_LIGHT: fact*= facg; copy_v3_v3(in, out); - ramp_blend(MA_RAMP_LINEAR, in, in+1, in+2, fact, tex); + ramp_blend(MA_RAMP_LINEAR, in, fact, tex); break; } } diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index b58a6695fd6..4d654beb287 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -908,7 +908,7 @@ static void ramp_diffuse_result(float *diff, ShadeInput *shi) /* blending method */ fac= col[3]*ma->rampfac_col; - ramp_blend(ma->rampblend_col, diff, diff+1, diff+2, fac, col); + ramp_blend(ma->rampblend_col, diff, fac, col); } } } @@ -955,7 +955,7 @@ static void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, floa colt[1]= shi->g; colt[2]= shi->b; - ramp_blend(ma->rampblend_col, colt, colt+1, colt+2, fac, col); + ramp_blend(ma->rampblend_col, colt, fac, col); /* output to */ diff[0] += r * colt[0]; @@ -970,20 +970,20 @@ static void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, floa } } -static void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi) +static void ramp_spec_result(float spec_col[3], ShadeInput *shi) { Material *ma= shi->mat; if(ma->ramp_spec && (ma->rampin_spec==MA_RAMP_IN_RESULT)) { float col[4]; - float fac= 0.3f*(*specr) + 0.58f*(*specg) + 0.12f*(*specb); + float fac= 0.3f*spec_col[0] + 0.58f*spec_col[1] + 0.12f*spec_col[2]; do_colorband(ma->ramp_spec, fac, col); /* blending method */ fac= col[3]*ma->rampfac_spec; - ramp_blend(ma->rampblend_spec, specr, specg, specb, fac, col); + ramp_blend(ma->rampblend_spec, spec_col, fac, col); } } @@ -1023,7 +1023,7 @@ static void do_specular_ramp(ShadeInput *shi, float is, float t, float spec[3]) /* blending method */ fac= col[3]*ma->rampfac_spec; - ramp_blend(ma->rampblend_spec, spec, spec+1, spec+2, fac, col); + ramp_blend(ma->rampblend_spec, spec, fac, col); } } @@ -1873,7 +1873,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) if(ma->mode & MA_RAMP_COL) ramp_diffuse_result(shr->combined, shi); } - if(ma->mode & MA_RAMP_SPEC) ramp_spec_result(shr->spec, shr->spec+1, shr->spec+2, shi); + if(ma->mode & MA_RAMP_SPEC) ramp_spec_result(shr->spec, shi); /* refcol is for envmap only */ if(shi->refcol[0]!=0.0f) { diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 1a7031c7d31..1df7f3228a0 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -464,7 +464,7 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports) int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory) { ListBase wmbase; - char tstr[FILE_MAXDIR+FILE_MAXFILE]; + char tstr[FILE_MAX]; int success= 0; free_ttfont(); /* still weird... what does it here? */ @@ -597,7 +597,7 @@ void WM_read_history(void) static void write_history(void) { struct RecentFile *recent, *next_recent; - char name[FILE_MAXDIR+FILE_MAXFILE]; + char name[FILE_MAX]; char *user_config_dir; FILE *fp; int i; @@ -810,7 +810,7 @@ int WM_write_homefile(bContext *C, wmOperator *op) { wmWindowManager *wm= CTX_wm_manager(C); wmWindow *win= CTX_wm_window(C); - char filepath[FILE_MAXDIR+FILE_MAXFILE]; + char filepath[FILE_MAX]; int fileflags; /* check current window and close it if temp */ @@ -922,7 +922,7 @@ void wm_autosave_delete(void) wm_autosave_location(filename); if(BLI_exists(filename)) { - char str[FILE_MAXDIR+FILE_MAXFILE]; + char str[FILE_MAX]; BLI_make_file_string("/", str, BLI_temporary_dir(), "quit.blend"); /* if global undo; remove tempsave, otherwise rename */ diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 72af805a65b..56f8909ca8f 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -259,9 +259,9 @@ static void draw_filled_lasso(wmGesture *gt) glColor4f(1.0, 1.0, 1.0, 0.05); glBegin(GL_TRIANGLES); for (efa = fillfacebase.first; efa; efa=efa->next) { - glVertex2f(efa->v1->co[0], efa->v1->co[1]); - glVertex2f(efa->v2->co[0], efa->v2->co[1]); - glVertex2f(efa->v3->co[0], efa->v3->co[1]); + glVertex2fv(efa->v1->co); + glVertex2fv(efa->v2->co); + glVertex2fv(efa->v3->co); } glEnd(); glDisable(GL_BLEND); diff --git a/source/creator/creator.c b/source/creator/creator.c index ff5f6fc26cc..c1de6868f7b 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -893,7 +893,7 @@ static int run_python(int argc, const char **argv, void *data) /* workaround for scripts not getting a bpy.context.scene, causes internal errors elsewhere */ if (argc > 1) { /* Make the path absolute because its needed for relative linked blends to be found */ - char filename[FILE_MAXDIR + FILE_MAXFILE]; + char filename[FILE_MAX]; BLI_strncpy(filename, argv[1], sizeof(filename)); BLI_path_cwd(filename); @@ -954,7 +954,7 @@ static int load_file(int UNUSED(argc), const char **argv, void *data) bContext *C = data; /* Make the path absolute because its needed for relative linked blends to be found */ - char filename[FILE_MAXDIR + FILE_MAXFILE]; + char filename[FILE_MAX]; BLI_strncpy(filename, argv[0], sizeof(filename)); BLI_path_cwd(filename); diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 140dbadee60..e84df921fd5 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -270,12 +270,12 @@ static void get_filename(int argc, char **argv, char *filename) if (argc > 1) { if (BLI_exists(argv[argc-1])) { - BLI_strncpy(filename, argv[argc-1], FILE_MAXDIR + FILE_MAXFILE); + BLI_strncpy(filename, argv[argc-1], FILE_MAX); } if (::strncmp(argv[argc-1], "-psn_", 5)==0) { static char firstfilebuf[512]; if (GHOST_HACK_getFirstFile(firstfilebuf)) { - BLI_strncpy(filename, firstfilebuf, FILE_MAXDIR + FILE_MAXFILE); + BLI_strncpy(filename, firstfilebuf, FILE_MAX); } } } @@ -289,7 +289,7 @@ static void get_filename(int argc, char **argv, char *filename) //::printf("looking for file: %s\n", filename); if (BLI_exists(gamefile)) - BLI_strncpy(filename, gamefile, FILE_MAXDIR + FILE_MAXFILE); + BLI_strncpy(filename, gamefile, FILE_MAX); delete [] gamefile; } @@ -298,7 +298,7 @@ static void get_filename(int argc, char **argv, char *filename) filename[0] = '\0'; if(argc > 1) - BLI_strncpy(filename, argv[argc-1], FILE_MAXDIR + FILE_MAXFILE); + BLI_strncpy(filename, argv[argc-1], FILE_MAX); #endif // !_APPLE } @@ -406,6 +406,7 @@ int main(int argc, char** argv) initglobals(); + U.gameflags |= USER_DISABLE_VBO; // We load our own G.main, so free the one that initglobals() gives us free_main(G.main); G.main = NULL; @@ -736,8 +737,8 @@ int main(int argc, char** argv) STR_String exitstring = ""; GPG_Application app(system); bool firstTimeRunning = true; - char filename[FILE_MAXDIR + FILE_MAXFILE]; - char pathname[FILE_MAXDIR + FILE_MAXFILE]; + char filename[FILE_MAX]; + char pathname[FILE_MAX]; char *titlename; get_filename(argc_py_clamped, argv, filename); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 02e6ebea71b..d9822d131eb 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -147,8 +147,8 @@ extern "C" { #ifdef WITH_PYTHON static RAS_ICanvas* gp_Canvas = NULL; -static char gp_GamePythonPath[FILE_MAXDIR + FILE_MAXFILE] = ""; -static char gp_GamePythonPathOrig[FILE_MAXDIR + FILE_MAXFILE] = ""; // not super happy about this, but we need to remember the first loaded file for the global/dict load save +static char gp_GamePythonPath[FILE_MAX] = ""; +static char gp_GamePythonPathOrig[FILE_MAX] = ""; // not super happy about this, but we need to remember the first loaded file for the global/dict load save static SCA_PythonKeyboard* gp_PythonKeyboard = NULL; static SCA_PythonMouse* gp_PythonMouse = NULL; @@ -237,13 +237,13 @@ The function also converts the directory separator to the local file system form static PyObject* gPyExpandPath(PyObject*, PyObject* args) { - char expanded[FILE_MAXDIR + FILE_MAXFILE]; + char expanded[FILE_MAX]; char* filename; if (!PyArg_ParseTuple(args,"s:ExpandPath",&filename)) return NULL; - BLI_strncpy(expanded, filename, FILE_MAXDIR + FILE_MAXFILE); + BLI_strncpy(expanded, filename, FILE_MAX); BLI_path_abs(expanded, gp_GamePythonPath); return PyUnicode_DecodeFSDefault(expanded); } @@ -496,7 +496,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args) list = PyList_New(0); if (searchpath) { - BLI_strncpy(cpath, searchpath, FILE_MAXDIR + FILE_MAXFILE); + BLI_strncpy(cpath, searchpath, FILE_MAX); BLI_path_abs(cpath, gp_GamePythonPath); } else { /* Get the dir only */ @@ -1728,7 +1728,7 @@ static void backupPySysObjects(void) static void initPySysObjects__append(PyObject *sys_path, const char *filename) { PyObject *item; - char expanded[FILE_MAXDIR + FILE_MAXFILE]; + char expanded[FILE_MAX]; BLI_split_dir_part(filename, expanded, sizeof(expanded)); /* get the dir part of filename only */ BLI_path_abs(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */ diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt index a025f5e3ec9..3e8dcaffcfe 100644 --- a/source/gameengine/VideoTexture/CMakeLists.txt +++ b/source/gameengine/VideoTexture/CMakeLists.txt @@ -51,6 +51,8 @@ set(INC_SYS ${GLEW_INCLUDE_PATH} ) +add_definitions(-DGLEW_STATIC) + set(SRC Exception.cpp FilterBase.cpp