diff options
381 files changed, 3114 insertions, 3525 deletions
diff --git a/GNUmakefile b/GNUmakefile index 47723354838..b448f93310d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -166,10 +166,11 @@ help: @echo " * test_deprecated - checks for deprecation tags in our code which may need to be removed" @echo "" @echo "Static Source Code Checking (not assosiated with building blender)" - @echo " * check_cppcheck - run blender source through cppcheck (C & C++)" - @echo " * check_splint - run blenders source through splint (C only)" - @echo " * check_sparse - run blenders source through sparse (C only)" - @echo " * check_spelling - check for spelling errors (Python only for now)" + @echo " * check_cppcheck - run blender source through cppcheck (C & C++)" + @echo " * check_splint - run blenders source through splint (C only)" + @echo " * check_sparse - run blenders source through sparse (C only)" + @echo " * check_spelling_c - check for spelling errors (C/C++ only)" + @echo " * check_spelling_py - check for spelling errors (Python only)" @echo "" @echo "Documentation Targets (not assosiated with building blender)" @echo " * doc_py - generate sphinx python api docs" @@ -243,8 +244,11 @@ check_sparse: $(CMAKE_CONFIG) cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py -check_spelling: - cd $(BUILD_DIR) ; PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py `find $(BLENDER_DIR)/release/scripts -name "*.py" | sort` +check_spelling_py: + cd $(BUILD_DIR) ; PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/release/scripts + +check_spelling_c: + cd $(BUILD_DIR) ; PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/source # ----------------------------------------------------------------------------- diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 79a534a969e..2b07b0c3611 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -20,42 +20,69 @@ # <pep8 compliant> -script_help_msg = ''' -Usage: +script_help_msg = """ -For HTML generation -------------------- -- Run this script from blenders root path once you have compiled blender +API dump in RST files +--------------------- + Run this script from blenders root path once you have compiled blender ./blender.bin --background -noaudio --python doc/python_api/sphinx_doc_gen.py This will generate python files in doc/python_api/sphinx-in/ providing ./blender.bin is or links to the blender executable -- Generate html docs by running... + To choose sphinx-in directory use the -o option, putting the path after '--'. + Example: + ./cmake/bin/blender -b -P ./blender/doc/python_api/sphinx_doc_gen.py -- -o ./python_api + +Sphinx: HTML generation +----------------------- + Generate html docs by running... cd doc/python_api sphinx-build sphinx-in sphinx-out This requires sphinx 1.0.7 to be installed. -For PDF generation ------------------- -- After you have built doc/python_api/sphinx-in (see above), run: +Sphinx: PDF generation +---------------------- + After you have built doc/python_api/sphinx-in (see above), run: sphinx-build -b latex doc/python_api/sphinx-in doc/python_api/sphinx-out cd doc/python_api/sphinx-out make -''' + +""" -# Check we're running in blender -if __import__("sys").modules.get("bpy") is None: +try: + import bpy # blender module +except: print("\nError, this script must run from inside blender") print(script_help_msg) - import sys sys.exit() +import rna_info # blender module + +# import rpdb2; rpdb2.start_embedded_debugger('test') +import os +import sys +import inspect +import shutil + +from platform import platform +PLATFORM = platform().split('-')[0].lower() # 'linux', 'darwin', 'windows' + +# this script dir +SCRIPT_DIR = os.path.dirname(__file__) + +# examples +EXAMPLES_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "examples")) +EXAMPLE_SET = set() +EXAMPLE_SET_USED = set() + +#rst files dir +RST_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "rst")) # Switch for quick testing if 1: @@ -106,7 +133,7 @@ sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out """ # extra info, not api reference docs -# stored in ./rst/info/ +# stored in ./rst/info_* INFO_DOCS = ( ("info_quickstart.rst", "Blender/Python Quickstart: new to blender/scripting and want to get your feet wet?"), ("info_overview.rst", "Blender/Python API Overview: a more complete explanation of python integration"), @@ -132,12 +159,6 @@ except ImportError: EXCLUDE_MODULES = EXCLUDE_MODULES + ("aud", ) -# import rpdb2; rpdb2.start_embedded_debugger('test') -import os -import inspect -import bpy -import rna_info - # lame, python wont give some access ClassMethodDescriptorType = type(dict.__dict__['fromkeys']) MethodDescriptorType = type(dict.get) @@ -145,9 +166,6 @@ GetSetDescriptorType = type(int.real) StaticMethodType = type(staticmethod(lambda: None)) from types import MemberDescriptorType -EXAMPLE_SET = set() -EXAMPLE_SET_USED = set() - _BPY_STRUCT_FAKE = "bpy_struct" _BPY_PROP_COLLECTION_FAKE = "bpy_prop_collection" _BPY_FULL_REBUILD = False @@ -220,7 +238,7 @@ def write_example_ref(ident, fw, example_id, ext="py"): if example_id in EXAMPLE_SET: # extract the comment - filepath = "../examples/%s.%s" % (example_id, ext) + filepath = os.path.join(EXAMPLES_DIR, "%s.%s" % (example_id, ext)) filepath_full = os.path.join(os.path.dirname(fw.__self__.name), filepath) text, line_no = example_extract_docstring(filepath_full) @@ -265,6 +283,7 @@ def write_indented_lines(ident, fn, text, strip=True): del lines[-1] if strip: + # set indentation to <indent> ident_strip = 1000 for l in lines: if l.strip(): @@ -272,6 +291,7 @@ def write_indented_lines(ident, fn, text, strip=True): for l in lines: fn(ident + l[ident_strip:] + "\n") else: + # add <indent> number of blanks to the current indentation for l in lines: fn(ident + l + "\n") @@ -1320,7 +1340,9 @@ def rna2sphinx(BASEPATH): if "bpy.context" not in EXCLUDE_MODULES: # one of a kind, context doc (uses ctypes to extract info!) - pycontext2sphinx(BASEPATH) + # doesn't work on mac + if PLATFORM != "darwin": + pycontext2sphinx(BASEPATH) # python modules if "bpy.utils" not in EXCLUDE_MODULES: @@ -1384,15 +1406,13 @@ def rna2sphinx(BASEPATH): #import bgl as module #pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper") #del module - import shutil - shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bgl.rst"), BASEPATH) + shutil.copy2(os.path.join(RST_DIR, "bgl.rst"), BASEPATH) if "gpu" not in EXCLUDE_MODULES: #import gpu as module #pymodule2sphinx(BASEPATH, "gpu", module, "GPU Shader Module") #del module - import shutil - shutil.copy2(os.path.join(BASEPATH, "..", "rst", "gpu.rst"), BASEPATH) + shutil.copy2(os.path.join(RST_DIR, "gpu.rst"), BASEPATH) if "aud" not in EXCLUDE_MODULES: import aud as module @@ -1400,21 +1420,21 @@ def rna2sphinx(BASEPATH): del module ## game engine - import shutil + # copy2 keeps time/date stamps if "bge" not in EXCLUDE_MODULES: - shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.types.rst"), BASEPATH) - shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.logic.rst"), BASEPATH) - shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.render.rst"), BASEPATH) - shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.texture.rst"), BASEPATH) - shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.events.rst"), BASEPATH) - shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.constraints.rst"), BASEPATH) + shutil.copy2(os.path.join(RST_DIR, "bge.types.rst"), BASEPATH) + shutil.copy2(os.path.join(RST_DIR, "bge.logic.rst"), BASEPATH) + shutil.copy2(os.path.join(RST_DIR, "bge.render.rst"), BASEPATH) + shutil.copy2(os.path.join(RST_DIR, "bge.texture.rst"), BASEPATH) + shutil.copy2(os.path.join(RST_DIR, "bge.events.rst"), BASEPATH) + shutil.copy2(os.path.join(RST_DIR, "bge.constraints.rst"), BASEPATH) - shutil.copy2(os.path.join(BASEPATH, "..", "rst", "change_log.rst"), BASEPATH) + shutil.copy2(os.path.join(RST_DIR, "change_log.rst"), BASEPATH) if not EXCLUDE_INFO_DOCS: for info, info_desc in INFO_DOCS: - shutil.copy2(os.path.join(BASEPATH, "..", "rst", info), BASEPATH) + shutil.copy2(os.path.join(RST_DIR, info), BASEPATH) if 0: filepath = os.path.join(BASEPATH, "bpy.rst") @@ -1436,53 +1456,89 @@ def rna2sphinx(BASEPATH): file.close() +def handle_args(): + ''' + get the args passed to blender after "--", all of which are ignored by blender + + we can give the path of sphinx-in after '--', using for example: + ./cmake/bin/blender -b -P ./blender/doc/python_api/sphinx_doc_gen.py -- ./python_api + ''' + + import argparse # to parse options for us and print a nice help message + + # When --help or no args are given, print the usage text + parser = argparse.ArgumentParser( + formatter_class=argparse.RawDescriptionHelpFormatter, + usage=script_help_msg) + + # output dir for apidocs + parser.add_argument("-o", "--output", + dest="output_dir", + type=str, + required=False, + help="Path of API docs directory (optional)") + + argv = [] + if "--" in sys.argv: + argv = sys.argv[sys.argv.index("--") + 1:] # get all args after "--" + + return parser.parse_args(argv) + + def main(): - import shutil + + args = handle_args() + + # output dirs + if args.output_dir: + output_dir = args.output_dir + if not os.path.exists(args.output_dir): + os.mkdir(args.output_dir) + else: + output_dir = SCRIPT_DIR - script_dir = os.path.dirname(__file__) - path_in = os.path.join(script_dir, "sphinx-in") - path_out = os.path.join(script_dir, "sphinx-out") - path_examples = os.path.join(script_dir, "examples") - # only for partial updates - path_in_tmp = path_in + "-tmp" + sphinx_in_dir = os.path.join(output_dir, "sphinx-in") + sphinx_out_dir = os.path.join(output_dir, "sphinx-out") - if not os.path.exists(path_in): - os.mkdir(path_in) + # only for partial updates + sphinx_in_tmp_dir = sphinx_in_dir + "-tmp" + if not os.path.exists(sphinx_in_dir): + os.mkdir(sphinx_in_dir) - for f in os.listdir(path_examples): + for f in os.listdir(EXAMPLES_DIR): if f.endswith(".py"): EXAMPLE_SET.add(os.path.splitext(f)[0]) # only for full updates if _BPY_FULL_REBUILD: - shutil.rmtree(path_in, True) - shutil.rmtree(path_out, True) + shutil.rmtree(sphinx_in_dir, True) + shutil.rmtree(sphinx_out_dir, True) else: # write here, then move - shutil.rmtree(path_in_tmp, True) + shutil.rmtree(sphinx_in_tmp_dir, True) - rna2sphinx(path_in_tmp) + rna2sphinx(sphinx_in_tmp_dir) if not _BPY_FULL_REBUILD: import filecmp - # now move changed files from 'path_in_tmp' --> 'path_in' - file_list_path_in = set(os.listdir(path_in)) - file_list_path_in_tmp = set(os.listdir(path_in_tmp)) + # now move changed files from 'sphinx_in_tmp_dir' --> 'sphinx_in_dir' + file_list_sphinx_in_dir = set(os.listdir(sphinx_in_dir)) + file_list_sphinx_in_tmp_dir = set(os.listdir(sphinx_in_tmp_dir)) # remove deprecated files that have been removed. - for f in sorted(file_list_path_in): - if f not in file_list_path_in_tmp: + for f in sorted(file_list_sphinx_in_dir): + if f not in file_list_sphinx_in_tmp_dir: print("\tdeprecated: %s" % f) - os.remove(os.path.join(path_in, f)) + os.remove(os.path.join(sphinx_in_dir, f)) # freshen with new files. - for f in sorted(file_list_path_in_tmp): - f_from = os.path.join(path_in_tmp, f) - f_to = os.path.join(path_in, f) + for f in sorted(file_list_sphinx_in_tmp_dir): + f_from = os.path.join(sphinx_in_tmp_dir, f) + f_to = os.path.join(sphinx_in_dir, f) do_copy = True - if f in file_list_path_in: + if f in file_list_sphinx_in_dir: if filecmp.cmp(f_from, f_to): do_copy = False @@ -1494,12 +1550,11 @@ def main(): EXAMPLE_SET_UNUSED = EXAMPLE_SET - EXAMPLE_SET_USED if EXAMPLE_SET_UNUSED: - print("\nUnused examples found in '%s'..." % path_examples) + print("\nUnused examples found in '%s'..." % EXAMPLES_DIR) for f in EXAMPLE_SET_UNUSED: print(" %s.py" % f) print(" %d total\n" % len(EXAMPLE_SET_UNUSED)) - import sys sys.exit() if __name__ == '__main__': diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index 019cd37066c..008d1462322 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -27,7 +27,7 @@ from bpy.props import (StringProperty, class SelectPattern(Operator): - '''Select object matching a naming pattern''' + '''Select objects matching a naming pattern''' bl_idname = "object.select_pattern" bl_label = "Select Pattern" bl_options = {'REGISTER', 'UNDO'} @@ -125,7 +125,7 @@ class SelectCamera(Operator): class SelectHierarchy(Operator): - '''Select object relative to the active object's position''' \ + '''Select object relative to the active object's position ''' \ '''in the hierarchy''' bl_idname = "object.select_hierarchy" bl_label = "Select Hierarchy" diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index 484719e4dec..5da41a668f6 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -88,7 +88,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel): col.prop(cam, "ortho_scale") col = layout.column() - col.enabled = cam.type == 'PERSPECTIVE' + col.enabled = cam.type == 'PERSP' col.prop(cam, "use_panorama") diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index ee5702e324e..16e14a7ead4 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -329,7 +329,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): col.prop(gs, "dome_angle", slider=True) col = split.column() - col.prop(gs, "dome_tesselation", text="Tesselation") + col.prop(gs, "dome_tessellation", text="Tessellation") col.prop(gs, "dome_tilt") elif dome_type == 'PANORAM_SPH': @@ -337,7 +337,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) col = split.column() - col.prop(gs, "dome_tesselation", text="Tesselation") + col.prop(gs, "dome_tessellation", text="Tessellation") else: # cube map col = split.column() diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index d6aeea8ece7..e1e47c1e85f 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -217,7 +217,7 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel): # paint-map output row = layout.row() - row.prop_search(surface, "output_name_a", ob.data, "vertex_colors", text="Paintmap layer: ") + row.prop_search(surface, "output_name_a", ob.data, "vertex_colors", text="Paintmap layer:") if surface.output_exists(object=ob, index=0): ic = 'ZOOMOUT' else: @@ -227,7 +227,7 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel): # wet-map output row = layout.row() - row.prop_search(surface, "output_name_b", ob.data, "vertex_colors", text="Wetmap layer: ") + row.prop_search(surface, "output_name_b", ob.data, "vertex_colors", text="Wetmap layer:") if surface.output_exists(object=ob, index=1): ic = 'ZOOMOUT' else: @@ -237,7 +237,7 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel): elif surface_type == 'WEIGHT': row = layout.row() - row.prop_search(surface, "output_name_a", ob, "vertex_groups", text="Vertex Group: ") + row.prop_search(surface, "output_name_a", ob, "vertex_groups", text="Vertex Group:") if surface.output_exists(object=ob, index=0): ic = 'ZOOMOUT' else: @@ -270,7 +270,7 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel): sub.prop(surface, "output_name_b", text="") else: col = layout.column() - col.prop(surface, "output_name_a", text="Filename: ") + col.prop(surface, "output_name_a", text="Filename:") if surface_type == 'DISPLACE': col.prop(surface, "displace_type", text="Displace Type") col.prop(surface, "depth_clamp") @@ -309,7 +309,7 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel): layout.prop_search(surface, "init_layername", ob.data, "uv_textures", text="UV Map:") elif surface.init_color_type == 'VERTEX_COLOR': - layout.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer: ") + layout.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer:") class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel): diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 3103dde31dc..dff783c1b9b 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -133,8 +133,8 @@ struct DerivedMesh { /* calculate vert and face normals */ void (*calcNormals)(DerivedMesh *dm); - /* recalculates mesh tesselation */ - void (*recalcTesselation)(DerivedMesh *dm); + /* recalculates mesh tessellation */ + void (*recalcTessellation)(DerivedMesh *dm); /* Misc. Queries */ @@ -407,19 +407,19 @@ struct DerivedMesh { void (*release)(DerivedMesh *dm); }; -/* utility function to initialise a DerivedMesh's function pointers to +/* utility function to initialize a DerivedMesh's function pointers to * the default implementation (for those functions which have a default) */ void DM_init_funcs(DerivedMesh *dm); -/* utility function to initialise a DerivedMesh for the desired number +/* utility function to initialize a DerivedMesh for the desired number * of vertices, edges and faces (doesn't allocate memory for them, just * sets up the custom data layers) */ void DM_init(DerivedMesh *dm, DerivedMeshType type, int numVerts, int numEdges, int numFaces, int numLoops, int numPolys); -/* utility function to initialise a DerivedMesh for the desired number +/* utility function to initialize a DerivedMesh for the desired number * of vertices, edges and faces, with a layer setup copied from source */ void DM_from_template(DerivedMesh *dm, DerivedMesh *source, diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 1c661b3804f..392642b5305 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -42,7 +42,7 @@ extern "C" { * and keep comment above the defines. * Use STRINGIFY() rather than defining with quotes */ #define BLENDER_VERSION 262 -#define BLENDER_SUBVERSION 0 +#define BLENDER_SUBVERSION 1 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h index d3d8546ddae..15c93bd58fa 100644 --- a/source/blender/blenkernel/BKE_bvhutils.h +++ b/source/blender/blenkernel/BKE_bvhutils.h @@ -75,7 +75,7 @@ typedef struct BVHTreeFromMesh * * The tree is build in mesh space coordinates, this means special care must be made on queries * so that the coordinates and rays are first translated on the mesh local coordinates. - * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse + * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becomes possible to reuse * a BVHTree. * * free_bvhtree_from_mesh should be called when the tree is no longer needed. @@ -88,7 +88,7 @@ BVHTree* bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMes * * The tree is build in mesh space coordinates, this means special care must be made on queries * so that the coordinates and rays are first translated on the mesh local coordinates. - * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse + * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becomes possible to reuse * a BVHTree. * * The returned value is the same as in data->tree, its only returned to make it easier to test @@ -124,7 +124,7 @@ typedef struct LinkNode* BVHCache; /* - * Queries a bvhcache for the chache bvhtree of the request type + * Queries a bvhcache for the cache bvhtree of the request type */ BVHTree *bvhcache_find(BVHCache *cache, int type); diff --git a/source/blender/blenkernel/BKE_cdderivedmesh.h b/source/blender/blenkernel/BKE_cdderivedmesh.h index 5fda391cd80..8ece5f14a96 100644 --- a/source/blender/blenkernel/BKE_cdderivedmesh.h +++ b/source/blender/blenkernel/BKE_cdderivedmesh.h @@ -106,13 +106,13 @@ void CDDM_calc_normals_tessface(struct DerivedMesh *dm); */ void CDDM_calc_edges_tessface(struct DerivedMesh *dm); -/* same as CDDM_calc_edges_tessface only makes edges from ngon faces instead of tesselation +/* same as CDDM_calc_edges_tessface only makes edges from ngon faces instead of tessellation faces*/ void CDDM_calc_edges(struct DerivedMesh *dm); /* reconstitute face triangulation */ -void CDDM_recalc_tesselation(struct DerivedMesh *dm); -void CDDM_recalc_tesselation_ex(struct DerivedMesh *dm, const int do_face_nor_cpy); +void CDDM_recalc_tessellation(struct DerivedMesh *dm); +void CDDM_recalc_tessellation_ex(struct DerivedMesh *dm, const int do_face_nor_cpy); /* lowers the number of vertices/edges/faces in a CDDerivedMesh * the layer data stays the same size diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 99676e444f3..b414f36b8c8 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -110,7 +110,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest, then goes through the mesh and makes sure all the customdata blocks are consistent with the new layout.*/ void CustomData_bmesh_merge(struct CustomData *source, struct CustomData *dest, - int mask, int alloctype, struct BMesh *bm, int type); + int mask, int alloctype, struct BMesh *bm, const char htype); /* frees data associated with a CustomData object (doesn't free the object * itself, though) @@ -319,7 +319,7 @@ void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata, int totloop, int totpoly); void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata, int total); void CustomData_bmesh_update_active_layers(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata); -void CustomData_bmesh_init_pool(struct CustomData *data, int allocsize); +void CustomData_bmesh_init_pool(struct CustomData *data, int totelem, const char htype); /* External file storage */ diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index d79d6a204b9..b615ac60c3e 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -135,7 +135,7 @@ typedef struct FModifierTypeInfo { void (*evaluate_modifier)(struct FCurve *fcu, struct FModifier *fcm, float *cvalue, float evaltime); } FModifierTypeInfo; -/* Values which describe the behaviour of a FModifier Type */ +/* Values which describe the behavior of a FModifier Type */ typedef enum eFMI_Action_Types { /* modifier only modifies values outside of data range */ FMI_TYPE_EXTRAPOLATION = 0, diff --git a/source/blender/blenkernel/BKE_idcode.h b/source/blender/blenkernel/BKE_idcode.h index d8e77abc989..2a01ef3afdb 100644 --- a/source/blender/blenkernel/BKE_idcode.h +++ b/source/blender/blenkernel/BKE_idcode.h @@ -35,8 +35,8 @@ /** * Convert an idcode into a name. * - * @param code The code to convert. - * @return A static string representing the name of + * \param code The code to convert. + * \return A static string representing the name of * the code. */ const char *BKE_idcode_to_name(int code); @@ -44,8 +44,8 @@ const char *BKE_idcode_to_name(int code); /** * Convert an idcode into a name (plural). * - * @param code The code to convert. - * @return A static string representing the name of + * \param code The code to convert. + * \return A static string representing the name of * the code. */ const char *BKE_idcode_to_name_plural(int code); @@ -53,32 +53,32 @@ const char *BKE_idcode_to_name_plural(int code); /** * Convert a name into an idcode (ie. ID_SCE) * - * @param name The name to convert. - * @return The code for the name, or 0 if invalid. + * \param name The name to convert. + * \return The code for the name, or 0 if invalid. */ int BKE_idcode_from_name(const char *name); /** * Return non-zero when an ID type is linkable. * - * @param code The code to check. - * @return Boolean, 0 when non linkable. + * \param code The code to check. + * \return Boolean, 0 when non linkable. */ int BKE_idcode_is_linkable(int code); /** * Return if the ID code is a valid ID code. * - * @param code The code to check. - * @return Boolean, 0 when invalid. + * \param code The code to check. + * \return Boolean, 0 when invalid. */ int BKE_idcode_is_valid(int code); /** * Return an ID code and steps the index forward 1. * - * @param index start as 0. - * @return the code, 0 when all codes have been returned. + * \param index start as 0. + * \return the code, 0 when all codes have been returned. */ int BKE_idcode_iter_step(int *index); diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 6c6153523b7..4a37252e3fb 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -64,19 +64,19 @@ extern "C" { struct BMesh *BKE_mesh_to_bmesh(struct Mesh *me, struct Object *ob); /* - * this function recreates a tesselation. - * returns number of tesselation faces. + * this function recreates a tessellation. + * returns number of tessellation faces. * - * use_poly_origindex sets whether or not the tesselation faces' origindex + * use_poly_origindex sets whether or not the tessellation faces' origindex * layer should point to original poly indices or real poly indices. * - * use_face_origindex sets the tesselation faces' origindex layer - * to point to the tesselation faces themselves, not the polys. + * use_face_origindex sets the tessellation faces' origindex layer + * to point to the tessellation faces themselves, not the polys. * * if both of the above are 0, it'll use the indices of the mpolys of the MPoly * data in pdata, and ignore the origindex layer altogether. */ -int mesh_recalcTesselation(struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata, +int mesh_recalcTessellation(struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata, struct MVert *mvert, int totface, int totloop, int totpoly, const int do_face_normals); @@ -198,7 +198,7 @@ typedef struct UvMapVert { /* UvElement stores per uv information so that we can quickly access information for a uv. * it is actually an improved UvMapVert, including an island and a direct pointer to the face - * to avoid initialising face arrays */ + * to avoid initializing face arrays */ typedef struct UvElement { /* Next UvElement corresponding to same vertex */ struct UvElement *next; diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 753161d0788..cb161b26ee5 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -364,6 +364,7 @@ int nodeUpdateID(struct bNodeTree *ntree, struct ID *id); void nodeFreePreview(struct bNode *node); int nodeSocketIsHidden(struct bNodeSocket *sock); +void nodeSocketSetType(struct bNodeSocket *sock, int type); /* ************** NODE TYPE ACCESS *************** */ @@ -636,7 +637,7 @@ void ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat); #define CMP_NODE_TRANSFORM 264 #define CMP_NODE_MOVIEDISTORTION 265 #define CMP_NODE_DOUBLEEDGEMASK 266 -#define CMP_NODE_OUTPUT_MULTI_FILE 267 +#define CMP_NODE_OUTPUT_MULTI_FILE__DEPRECATED 267 /* DEPRECATED multi file node has been merged into regular CMP_NODE_OUTPUT_FILE */ #define CMP_NODE_GLARE 301 #define CMP_NODE_TONEMAP 302 @@ -676,8 +677,9 @@ void ntreeCompositTagGenerators(struct bNodeTree *ntree); void ntreeCompositForceHidden(struct bNodeTree *ntree, struct Scene *scene); void ntreeCompositClearTags(struct bNodeTree *ntree); -void ntreeCompositOutputMultiFileAddSocket(struct bNodeTree *ntree, struct bNode *node, struct ImageFormatData *im_format); -int ntreeCompositOutputMultiFileRemoveActiveSocket(struct bNodeTree *ntree, struct bNode *node); +struct bNodeSocket *ntreeCompositOutputFileAddSocket(struct bNodeTree *ntree, struct bNode *node, + const char *name, struct ImageFormatData *im_format); +int ntreeCompositOutputFileRemoveActiveSocket(struct bNodeTree *ntree, struct bNode *node); /* ************** TEXTURE NODES *************** */ diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index d787993e030..d54874f1fb8 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -170,7 +170,7 @@ void give_ibuf_prefetch_request(SeqRenderData context, float cfra, int chan_show int seqbase_recursive_apply(struct ListBase *seqbase, int (*apply_func)(struct Sequence *seq, void *), void *arg); int seq_recursive_apply(struct Sequence *seq, int (*apply_func)(struct Sequence *, void *), void *arg); -/* maintainance functions, mostly for RNA */ +/* maintenance functions, mostly for RNA */ // extern void seq_free_sequence(struct Scene *scene, struct Sequence *seq); void seq_free_sequence_recurse(struct Scene *scene, struct Sequence *seq); diff --git a/source/blender/blenkernel/BKE_tessmesh.h b/source/blender/blenkernel/BKE_tessmesh.h index cc3f2870711..d935c932387 100644 --- a/source/blender/blenkernel/BKE_tessmesh.h +++ b/source/blender/blenkernel/BKE_tessmesh.h @@ -40,7 +40,7 @@ ok: the EDBM module is for editmode bmesh stuff. in contrast, the /*this structure replaces EditMesh. through this, you get access to both the edit bmesh, - it's tesselation, and various stuff that doesn't belong in the BMesh + it's tessellation, and various stuff that doesn't belong in the BMesh struct itself. the entire derivedmesh and modifier system works with this structure, @@ -52,7 +52,7 @@ typedef struct BMEditMesh { struct BMEditMesh *emcopy; int emcopyusers; - /*we store tesselations as triplets of three loops, + /*we store tessellations as triplets of three loops, which each define a triangle.*/ struct BMLoop *(*looptris)[3]; int tottri; @@ -85,9 +85,10 @@ typedef struct BMEditMesh { * BMESH_TODO, look into having the update elsewhere. */ #define BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND -void BMEdit_RecalcTesselation(BMEditMesh *tm); +void BMEdit_RecalcTessellation(BMEditMesh *tm); BMEditMesh *BMEdit_Create(BMesh *bm, int do_tesselate); BMEditMesh *BMEdit_Copy(BMEditMesh *tm); +BMEditMesh *BMEdit_FromObject(struct Object *ob); void BMEdit_Free(BMEditMesh *em); void BMEdit_UpdateLinkedCustomData(BMEditMesh *em); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 16dd722f1fc..0d12785872c 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -360,7 +360,7 @@ void DM_ensure_tessface(DerivedMesh *dm) const int numPolys = dm->getNumPolys(dm); if ( (numTessFaces == 0) && (numPolys != 0)) { - dm->recalcTesselation(dm); + dm->recalcTessellation(dm); if (dm->getNumTessFaces(dm) != 0) { /* printf("info %s: polys -> ngons calculated\n", __func__); */ @@ -1091,9 +1091,9 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag, wtcol_v = calc_weightpaint_vert_array(ob, dm, draw_flag, coba); /* Now copy colors in all face verts. */ - /*first add colors to the tesselation faces*/ + /*first add colors to the tessellation faces*/ /* XXX Why update that layer? We have to update WEIGHT_MLOOPCOL anyway, - * and tesselation recreates mface layers from mloop/mpoly ones, so no + * and tessellation recreates mface layers from mloop/mpoly ones, so no * need to fill WEIGHT_MCOL here. */ #if 0 for (i = 0; i < numFaces; i++, mf++, wtcol_f_step += (4 * 4)) { @@ -1359,7 +1359,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos } } } else { - /* default behaviour for meshes */ + /* default behavior for meshes */ if(inputVertexCos) deformedVerts = inputVertexCos; else @@ -1661,7 +1661,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos /* calculating normals can re-calculate tessfaces in some cases */ int num_tessface = finaldm->getNumTessFaces(finaldm); /* --------------------------------------------------------------------- */ - /* First calculate the polygon and vertex normals, re-tesselation + /* First calculate the polygon and vertex normals, re-tessellation * copies these into the tessface's normal layer */ @@ -1673,13 +1673,13 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos finaldm->calcNormals(finaldm); #endif - /* Re-tesselation is necessary to push render data (uvs, textures, colors) + /* Re-tessellation is necessary to push render data (uvs, textures, colors) * from loops and polys onto the tessfaces. This may be currently be - * redundantin cases where the render mode doesn't use these inputs, but - * ideally eventually tesselation would happen on-demand, and this is one + * redundant in cases where the render mode doesn't use these inputs, but + * ideally eventually tessellation would happen on-demand, and this is one * of the primary places it would be needed. */ if (num_tessface == 0 && finaldm->getNumTessFaces(finaldm) == 0) { - finaldm->recalcTesselation(finaldm); + finaldm->recalcTessellation(finaldm); } /* Need to watch this, it can cause issues, see bug [#29338] */ /* take care with this block, we really need testing frameworks */ diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 77523980a64..6f3facb6d9d 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -81,7 +81,7 @@ static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBas /* ******************************************************************** */ /* Animation Visualisation */ -/* Initialise the default settings for animation visualisation */ +/* Initialize the default settings for animation visualisation */ void animviz_settings_init(bAnimVizSettings *avs) { /* sanity check */ @@ -234,7 +234,7 @@ typedef struct MPathTarget { /* get list of motion paths to be baked for the given object * - assumes the given list is ready to be used */ -// TODO: it would be nice in future to be able to update objects dependant on these bones too? +// TODO: it would be nice in future to be able to update objects dependent on these bones too? void animviz_get_object_motionpaths(Object *ob, ListBase *targets) { MPathTarget *mpt; @@ -318,7 +318,7 @@ static void motionpaths_calc_update_scene(Scene *scene) /* find the last object with the tag * - all those afterwards are assumed to not be relevant for our calculations */ - // optimise further by moving out... + // optimize further by moving out... for (base=scene->base.first; base; base=base->next) { if (base->object->flag & BA_TEMP_TAG) last = base; @@ -416,7 +416,7 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets) } if (efra <= sfra) return; - /* optimise the depsgraph for faster updates */ + /* optimize the depsgraph for faster updates */ // TODO: whether this is used should depend on some setting for the level of optimisations used motionpaths_calc_optimise_depsgraph(scene, targets); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 9867292d2ab..ec5bfbb2cdc 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1183,7 +1183,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i if (RNA_property_update_check(prop)) { short skip_updates_hack = 0; - /* optimisation hacks: skip property updates for those properties + /* optimization hacks: skip property updates for those properties * for we know that which the updates in RNA were really just for * flushing property editing via UI/Py */ @@ -1683,7 +1683,7 @@ static void nlaevalchan_buffers_accumulate (ListBase *channels, ListBase *tmp_bu { NlaEvalChannel *nec, *necn, *necd; - /* optimise - abort if no channels */ + /* optimize - abort if no channels */ if (tmp_buffer->first == NULL) return; @@ -2151,7 +2151,7 @@ static void animsys_evaluate_overrides (PointerRNA *ptr, AnimData *adt) /* Overview of how this system works: * 1) Depsgraph sorts data as necessary, so that data is in an order that means - * that all dependences are resolved before dependants. + * that all dependencies are resolved before dependants. * 2) All normal animation is evaluated, so that drivers have some basis values to * work with * a. NLA stacks are done first, as the Active Actions act as 'tweaking' tracks @@ -2160,14 +2160,14 @@ static void animsys_evaluate_overrides (PointerRNA *ptr, AnimData *adt) * * --------------< often in a separate phase... >------------------ * - * 3) Drivers/expressions are evaluated on top of this, in an order where dependences are + * 3) Drivers/expressions are evaluated on top of this, in an order where dependencies are * resolved nicely. * Note: it may be necessary to have some tools to handle the cases where some higher-level * drivers are added and cause some problematic dependencies that didn't exist in the local levels... * * --------------< always executed >------------------ * - * Maintainance of editability of settings (XXX): + * Maintenance of editability of settings (XXX): * In order to ensure that settings that are animated can still be manipulated in the UI without requiring * that keyframes are added to prevent these values from being overwritten, we use 'overrides'. * @@ -2295,13 +2295,13 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime) } \ } - /* optimisation: + /* optimization: * when there are no actions, don't go over database and loop over heaps of datablocks, * which should ultimately be empty, since it is not possible for now to have any animation * without some actions, and drivers wouldn't get affected by any state changes * * however, if there are some curves, we will need to make sure that their 'ctime' property gets - * set correctly, so this optimisation must be skipped in that case... + * set correctly, so this optimization must be skipped in that case... */ if ((main->action.first == NULL) && (main->curve.first == NULL)) { if (G.f & G_DEBUG) @@ -2357,7 +2357,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime) /* objects */ /* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets - * this tagged by Depsgraph on framechange. This optimisation means that objects + * this tagged by Depsgraph on framechange. This optimization means that objects * linked from other (not-visible) scenes will not need their data calculated. */ EVAL_ANIM_IDS(main->object.first, 0); diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index f4416b8f5d6..0af3c9c9f02 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -595,7 +595,7 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float /* XXX, for snap only, em & dm are assumed to be aligned, since dm is the em's cage */ - /*Insert BMesh-tesselation triangles into the bvh tree, unless they are hidden + /*Insert BMesh-tessellation triangles into the bvh tree, unless they are hidden and/or selected. Even if the faces themselves are not selected for the snapped transform, having a vertex selected means the face (and thus it's tesselated triangles) will be moving and will not be a good snap targets.*/ diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 39cfd1ad9e6..50d0f2daab9 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1589,11 +1589,11 @@ static void cdDM_foreachMappedFaceCenter( } -void CDDM_recalc_tesselation_ex(DerivedMesh *dm, const int do_face_nor_cpy) +void CDDM_recalc_tessellation_ex(DerivedMesh *dm, const int do_face_nor_cpy) { CDDerivedMesh *cddm = (CDDerivedMesh*)dm; - dm->numTessFaceData = mesh_recalcTesselation(&dm->faceData, &dm->loopData, &dm->polyData, + dm->numTessFaceData = mesh_recalcTessellation(&dm->faceData, &dm->loopData, &dm->polyData, cddm->mvert, dm->numTessFaceData, dm->numLoopData, dm->numPolyData, do_face_nor_cpy); @@ -1605,14 +1605,14 @@ void CDDM_recalc_tesselation_ex(DerivedMesh *dm, const int do_face_nor_cpy) cddm->mface = CustomData_get_layer(&dm->faceData, CD_MFACE); - /* Tesselation recreated faceData, and the active layer indices need to get re-propagated + /* Tessellation recreated faceData, and the active layer indices need to get re-propagated from loops and polys to faces */ CustomData_bmesh_update_active_layers(&dm->faceData, &dm->polyData, &dm->loopData); } -void CDDM_recalc_tesselation(DerivedMesh *dm) +void CDDM_recalc_tessellation(DerivedMesh *dm) { - CDDM_recalc_tesselation_ex(dm, TRUE); + CDDM_recalc_tessellation_ex(dm, TRUE); } static void cdDM_free_internal(CDDerivedMesh *cddm) @@ -1674,7 +1674,7 @@ static CDDerivedMesh *cdDM_create(const char *desc) dm->getTessFaceDataArray = DM_get_tessface_data_layer; dm->calcNormals = CDDM_calc_normals_mapping; - dm->recalcTesselation = CDDM_recalc_tesselation; + dm->recalcTessellation = CDDM_recalc_tessellation; dm->getVertCos = cdDM_getVertCos; dm->getVertCo = cdDM_getVertCo; @@ -1928,7 +1928,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis CustomData_merge(&bm->pdata, &dm->polyData, mask, CD_CALLOC, dm->numPolyData); - /*add tesselation mface layers*/ + /*add tessellation mface layers*/ if (use_tessface) { CustomData_from_bmeshpoly(&dm->faceData, &dm->polyData, &dm->loopData, em->tottri); } @@ -2083,7 +2083,7 @@ static DerivedMesh *cddm_copy_ex(DerivedMesh *source, int faces_from_tessfaces) #if 0 /* BMESH_TODO: Find out why this is necessary (or else find a way to remove it). If it is necessary, add a comment explaining why. */ - CDDM_recalc_tesselation((DerivedMesh *)cddm); + CDDM_recalc_tessellation((DerivedMesh *)cddm); #endif return dm; @@ -2100,7 +2100,7 @@ DerivedMesh *CDDM_copy_from_tessface(DerivedMesh *source) } /* note, the CD_ORIGINDEX layers are all 0, so if there is a direct - * relationship betwen mesh data this needs to be set by the caller. */ + * relationship between mesh data this needs to be set by the caller. */ DerivedMesh *CDDM_from_template(DerivedMesh *source, int numVerts, int numEdges, int numTessFaces, int numLoops, int numPolys) @@ -2190,15 +2190,15 @@ void CDDM_calc_normals_mapping(DerivedMesh *dm) if (dm->numTessFaceData == 0) { - /* No tesselation on this mesh yet, need to calculate one. + /* No tessellation on this mesh yet, need to calculate one. * * Important not to update face normals from polys since it * interfears with assigning the new normal layer in the following code. */ - CDDM_recalc_tesselation_ex(dm, FALSE); + CDDM_recalc_tessellation_ex(dm, FALSE); } else { - /* A tesselation already exists, it should always have a CD_POLYINDEX */ + /* A tessellation already exists, it should always have a CD_POLYINDEX */ BLI_assert(CustomData_has_layer(&dm->faceData, CD_POLYINDEX)); CustomData_free_layers(&dm->faceData, CD_NORMAL, dm->numTessFaceData); } @@ -2269,7 +2269,7 @@ void CDDM_calc_normals_tessface(DerivedMesh *dm) * * this is a really horribly written function. ger. - joeedh * - * note, CDDM_recalc_tesselation has to run on the returned DM if you want to access tessfaces. + * note, CDDM_recalc_tessellation has to run on the returned DM if you want to access tessfaces. */ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap) { diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index ecb1ae4bed3..5e65d104a03 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -1380,7 +1380,7 @@ static void machine_epsilon_offset(Cloth *cloth) cv = cloth->verts; for (i=0; i<cloth->numverts; i++, cv++) { - /*aggrevatingly enough, it's necassary to offset the coordinates + /*aggrevatingly enough, it's necessary to offset the coordinates by a multiple of the 32-bit floating point epsilon when switching into doubles*/ #define RNDSIGN (float)(-1*(BLI_rand()%2==0)|1) diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index e8cd1526880..c66b8da0dcd 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -279,7 +279,7 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4 /* prevent crashes in these unlikely events */ if (ob==NULL || mat==NULL) return; - /* optimise trick - check if need to do anything */ + /* optimize trick - check if need to do anything */ if (from == to) return; /* are we dealing with pose-channels or objects */ @@ -671,7 +671,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *UNUSED(cob), bC } /* This following macro should be used for all standard single-target *_get_tars functions - * to save typing and reduce maintainance woes. + * to save typing and reduce maintenance woes. * (Hopefully all compilers will be happy with the lines with just a space on them. Those are * really just to help this code easier to read) */ @@ -705,7 +705,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *UNUSED(cob), bC } /* This following macro should be used for all standard single-target *_get_tars functions - * to save typing and reduce maintainance woes. It does not do the subtarget related operations + * to save typing and reduce maintenance woes. It does not do the subtarget related operations * (Hopefully all compilers will be happy with the lines with just a space on them. Those are * really just to help this code easier to read) */ @@ -724,7 +724,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *UNUSED(cob), bC } /* This following macro should be used for all standard single-target *_flush_tars functions - * to save typing and reduce maintainance woes. + * to save typing and reduce maintenance woes. * Note: the pointer to ct will be changed to point to the next in the list (as it gets removed) * (Hopefully all compilers will be happy with the lines with just a space on them. Those are * really just to help this code easier to read) @@ -745,7 +745,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *UNUSED(cob), bC } /* This following macro should be used for all standard single-target *_flush_tars functions - * to save typing and reduce maintainance woes. It does not do the subtarget related operations. + * to save typing and reduce maintenance woes. It does not do the subtarget related operations. * Note: the pointer to ct will be changed to point to the next in the list (as it gets removed) * (Hopefully all compilers will be happy with the lines with just a space on them. Those are * really just to help this code easier to read) @@ -2148,7 +2148,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint float s, t; short axis; - /* initialise return matrix */ + /* initialize return matrix */ unit_m4(ct->matrix); /* get the transform matrix of the target */ @@ -2221,7 +2221,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint object_to_mat4(&workob, ct->matrix); } else { - /* behaviour undefined... */ + /* behavior undefined... */ puts("Error: unknown owner type for Action Constraint"); } } @@ -3920,7 +3920,7 @@ static bConstraintTypeInfo CTI_PIVOT = { NULL, /* relink data */ pivotcon_id_looper, /* id looper */ NULL, /* copy data */ - NULL, /* new data */ // XXX: might be needed to get 'normal' pivot behaviour... + NULL, /* new data */ // XXX: might be needed to get 'normal' pivot behavior... pivotcon_get_tars, /* get constraint targets */ pivotcon_flush_tars, /* flush constraint targets */ default_get_tarmat, /* get target matrix */ @@ -4294,7 +4294,7 @@ static void constraints_init_typeinfo (void) */ bConstraintTypeInfo *get_constraint_typeinfo (int type) { - /* initialise the type-info list? */ + /* initialize the type-info list? */ if (CTI_INIT) { constraints_init_typeinfo(); CTI_INIT = 0; @@ -4412,7 +4412,7 @@ static bConstraint *add_new_constraint_internal (const char *name, short type) /* Determine a basic name, and info */ if (cti) { - /* initialise constraint data */ + /* initialize constraint data */ con->data = MEM_callocN(cti->size, cti->structName); /* only constraints that change any settings need this */ @@ -4757,7 +4757,7 @@ void get_constraint_targets_for_solving (bConstraint *con, bConstraintOb *cob, L cti->get_constraint_targets(con, targets); /* set matrices - * - calculate if possible, otherwise just initialise as identity matrix + * - calculate if possible, otherwise just initialize as identity matrix */ if (cti->get_target_matrix) { for (ct= targets->first; ct; ct= ct->next) diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 7ed9a7603ac..cd15c56cea1 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -51,6 +51,7 @@ #include "BLI_mempool.h" #include "BLI_utildefines.h" +#include "BKE_utildefines.h" #include "BKE_customdata.h" #include "BKE_customdata_file.h" #include "BKE_global.h" @@ -104,7 +105,7 @@ typedef struct LayerTypeInfo { default is assumed to be all zeros */ void (*set_default)(void *data, int count); - /* functions necassary for geometry collapse*/ + /* functions necessary for geometry collapse*/ int (*equal)(void *data1, void *data2); void (*multiply)(void *data, float fac); void (*initminmax)(void *min, void *max); @@ -1081,7 +1082,7 @@ const CustomDataMask CD_MASK_DERIVEDMESH = CD_MASK_ORIGINDEX | CD_MASK_POLYINDEX; const CustomDataMask CD_MASK_BMESH = CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL | CD_MASK_MTEXPOLY | CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_PROP_FLT | CD_MASK_PROP_INT | - CD_MASK_PROP_STR | CD_MASK_SHAPEKEY | CD_MASK_SHAPE_KEYINDEX | CD_MASK_MDISPS; + CD_MASK_PROP_STR | CD_MASK_SHAPEKEY | CD_MASK_SHAPE_KEYINDEX | CD_MASK_MDISPS | CD_MASK_CREASE | CD_MASK_BWEIGHT; const CustomDataMask CD_MASK_FACECORNERS = CD_MASK_MTFACE | CD_MASK_MCOL | CD_MASK_MTEXPOLY | CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL; @@ -1664,7 +1665,7 @@ void *CustomData_duplicate_referenced_layer(struct CustomData *data, const int t layer = &data->layers[layer_index]; if (layer->flag & CD_FLAG_NOFREE) { - /* MEM_dupallocN won’t work in case of complex layers, like e.g. + /* MEM_dupallocN won't work in case of complex layers, like e.g. * CD_MDEFORMVERT, which has pointers to allocated data... * So in case a custom copy function is defined, use it! */ @@ -1697,7 +1698,7 @@ void *CustomData_duplicate_referenced_layer_named(struct CustomData *data, layer = &data->layers[layer_index]; if (layer->flag & CD_FLAG_NOFREE) { - /* MEM_dupallocN won’t work in case of complex layers, like e.g. + /* MEM_dupallocN won't work in case of complex layers, like e.g. * CD_MDEFORMVERT, which has pointers to allocated data... * So in case a custom copy function is defined, use it! */ @@ -2110,19 +2111,32 @@ void CustomData_bmesh_update_active_layers(CustomData *fdata, CustomData *pdata, } } -void CustomData_bmesh_init_pool(CustomData *data, int allocsize) +void CustomData_bmesh_init_pool(CustomData *data, int totelem, const char htype) { + int chunksize; + /* Dispose old pools before calling here to avoid leaks */ BLI_assert(data->pool == NULL); + switch (htype) { + case BM_VERT: chunksize = bm_mesh_chunksize_default.totvert; break; + case BM_EDGE: chunksize = bm_mesh_chunksize_default.totedge; break; + case BM_LOOP: chunksize = bm_mesh_chunksize_default.totloop; break; + case BM_FACE: chunksize = bm_mesh_chunksize_default.totface; break; + default: + BLI_assert(0); + chunksize = 512; + break; + } + /* If there are no layers, no pool is needed just yet */ if (data->totlayer) { - data->pool = BLI_mempool_create(data->totsize, allocsize, allocsize, TRUE, FALSE); + data->pool = BLI_mempool_create(data->totsize, totelem, chunksize, BLI_MEMPOOL_SYSMALLOC); } } void CustomData_bmesh_merge(CustomData *source, CustomData *dest, - int mask, int alloctype, BMesh *bm, int type) + int mask, int alloctype, BMesh *bm, const char htype) { BMHeader *h; BMIter iter; @@ -2131,9 +2145,9 @@ void CustomData_bmesh_merge(CustomData *source, CustomData *dest, int t; CustomData_merge(source, dest, mask, alloctype, 0); - CustomData_bmesh_init_pool(dest, 512); + CustomData_bmesh_init_pool(dest, 512, htype); - switch (type) { + switch (htype) { case BM_VERT: t = BM_VERTS_OF_MESH; break; case BM_EDGE: diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 822293c35e1..f2246da930c 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -603,7 +603,7 @@ MDeformWeight *defvert_verify_index(MDeformVert *dvert, const int defgroup) /* TODO. merge with code above! */ /* Adds the given vertex to the specified vertex group, with given weight. - * warning, this does NOT check for existign, assume caller already knows its not there */ + * warning, this does NOT check for existing, assume caller already knows its not there */ void defvert_add_index_notest(MDeformVert *dvert, int defgroup, const float weight) { MDeformWeight *dw_new; diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index a5097054de2..c45687f0b93 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -1116,7 +1116,7 @@ void graph_bfs(void) pos[i] = 0; /* Init - * dagnode.first is alway the root (scene) + * dagnode.first is always the root (scene) */ node = MainDag->DagNode.first; while(node) { @@ -1185,7 +1185,7 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a /* fprintf(stderr,"starting BFS \n ------------\n"); */ /* Init - * dagnode.first is alway the root (scene) + * dagnode.first is always the root (scene) */ node = dag->DagNode.first; nqueue = queue_create(DAGQUEUEALLOC); @@ -1252,7 +1252,7 @@ DagNodeQueue * graph_dfs(void) pos[i] = 0; /* Init - * dagnode.first is alway the root (scene) + * dagnode.first is always the root (scene) */ node = MainDag->DagNode.first; while(node) { @@ -1376,7 +1376,7 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a nqueue = queue_create(DAGQUEUEALLOC); /* Init - * dagnode.first is alway the root (scene) + * dagnode.first is always the root (scene) */ node = dag->DagNode.first; while(node) { diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index ea84f73b27f..6383f7b9040 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -709,7 +709,7 @@ static ModifierData *curve_get_tesselate_point(Scene *scene, Object *ob, int for if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) { preTesselatePoint = md; - /* this modifiers are moving point of tesselation automatically + /* this modifiers are moving point of tessellation automatically (some of them even can't be applied on tesselated curve), set flag for incformation button in modifier's header */ md->mode |= eModifierMode_ApplyOnSpline; @@ -1168,7 +1168,7 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase, } /* make copy of 'undeformed" displist for texture space calculation - actually, it's not totally undeformed -- pre-tesselation modifiers are + actually, it's not totally undeformed -- pre-tessellation modifiers are already applied, thats how it worked for years, so keep for compatibility (sergey) */ copy_displist(&cu->disp, dispbase); @@ -1394,7 +1394,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba if(cu->flag & CU_PATH) calc_curvepath(ob); /* make copy of 'undeformed" displist for texture space calculation - actually, it's not totally undeformed -- pre-tesselation modifiers are + actually, it's not totally undeformed -- pre-tessellation modifiers are already applied, thats how it worked for years, so keep for compatibility (sergey) */ copy_displist(&cu->disp, dispbase); diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index edd1bc6d679..83d64f693e2 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -84,7 +84,7 @@ static float gaussianFactors[5] = { 0.996849f, 0.524141f}; static float gaussianTotal = 3.309425f; -/* UV Image neighbouring pixel table x and y list */ +/* UV Image neighboring pixel table x and y list */ static int neighX[8] = {1,1,0,-1,-1,-1, 0, 1}; static int neighY[8] = {0,1,1, 1, 0,-1,-1,-1}; @@ -139,7 +139,7 @@ typedef struct Vec3f { } Vec3f; typedef struct BakeAdjPoint { - float dir[3]; /* vector pointing towards this neighbour */ + float dir[3]; /* vector pointing towards this neighbor */ float dist; /* distance to */ } BakeAdjPoint; @@ -160,7 +160,7 @@ typedef struct PaintBakeData { Bounds3D mesh_bounds; /* adjacency info */ - BakeAdjPoint *bNeighs; /* current global neighbour distances and directions, if required */ + BakeAdjPoint *bNeighs; /* current global neighbor distances and directions, if required */ double average_dist; /* space partitioning */ VolumeGrid *grid; /* space partitioning grid to optimize brush checks */ @@ -183,7 +183,7 @@ typedef struct PaintUVPoint { unsigned int v1, v2, v3; /* vertex indexes */ unsigned int neighbour_pixel; /* If this pixel isn't uv mapped to any face, - but it's neighbouring pixel is */ + but it's neighboring pixel is */ short quad; } PaintUVPoint; @@ -196,7 +196,7 @@ typedef struct ImgSeqFormatData { #define ADJ_ON_MESH_EDGE (1<<0) typedef struct PaintAdjData { - int *n_target; /* array of neighbouring point indexes, + int *n_target; /* array of neighboring point indexes, for single sample use (n_index+neigh_num) */ int *n_index; /* index to start reading n_target for each point */ int *n_num; /* num of neighs for each point */ @@ -1308,7 +1308,7 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, int for n_pos += ad->n_num[i]; } - /* and now add neighbour data using that info */ + /* and now add neighbor data using that info */ for (i=0; i<numOfEdges; i++) { /* first vertex */ int index = edge[i].v1; @@ -1889,7 +1889,7 @@ struct DerivedMesh *dynamicPaint_Modifier_do(DynamicPaintModifierData *pmd, Scen /***************************** Image Sequence / UV Image Surface Calls ******************************/ /* -* Tries to find the neighbouring pixel in given (uv space) direction. +* Tries to find the neighboring pixel in given (uv space) direction. * Result is used by effect system to move paint on the surface. * * px,py : origin pixel x and y @@ -1898,7 +1898,7 @@ struct DerivedMesh *dynamicPaint_Modifier_do(DynamicPaintModifierData *pmd, Scen static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh *dm, const char *uvname, int w, int h, int px, int py, int n_index) { - /* Note: Current method only uses polygon edges to detect neighbouring pixels. + /* Note: Current method only uses polygon edges to detect neighboring pixels. * -> It doesn't always lead to the optimum pixel but is accurate enough * and faster/simplier than including possible face tip point links) */ @@ -1914,11 +1914,11 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh if (x<0 || x>=w) return OUT_OF_TEXTURE; if (y<0 || y>=h) return OUT_OF_TEXTURE; - tPoint = &tempPoints[x+w*y]; /* UV neighbour */ + tPoint = &tempPoints[x+w*y]; /* UV neighbor */ cPoint = &tempPoints[px+w*py]; /* Origin point */ /* - * Check if shifted point is on same face -> it's a correct neighbour + * Check if shifted point is on same face -> it's a correct neighbor * (and if it isn't marked as an "edge pixel") */ if ((tPoint->face_index == cPoint->face_index) && (tPoint->neighbour_pixel == -1)) @@ -1937,11 +1937,11 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh } /* - * If we get here, the actual neighbouring pixel + * If we get here, the actual neighboring pixel * is located on a non-linked uv face, and we have to find * it's "real" position. * - * Simple neighbouring face finding algorithm: + * Simple neighboring face finding algorithm: * - find closest uv edge to shifted pixel and get * the another face that shares that edge * - find corresponding position of that new face edge @@ -2075,7 +2075,7 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh if (tempPoints[final_index].face_index != target_face) return NOT_FOUND; /* - * If final point is an "edge pixel", use it's "real" neighbour instead + * If final point is an "edge pixel", use it's "real" neighbor instead */ if (tempPoints[final_index].neighbour_pixel != -1) final_index = cPoint->neighbour_pixel; @@ -2322,7 +2322,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface) /* * Now loop through every pixel that was left without index - * and find if they have neighbouring pixels that have an index. + * and find if they have neighboring pixels that have an index. * If so use that polygon as pixel surface. * (To avoid seams on uv island edges) */ @@ -2350,14 +2350,14 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface) point[0] = ((float)tx + 0.5f) / w; point[1] = ((float)ty + 0.5f) / h; - /* search through defined area for neighbour */ + /* search through defined area for neighbor */ for (u=u_min; u<=u_max; u++) for (v=v_min; v<=v_max; v++) { /* if not this pixel itself */ if (u!=0 || v!=0) { ind = (tx+u)+w*(ty+v); - /* if neighbour has index */ + /* if neighbor has index */ if (tempPoints[ind].face_index != -1) { float uv1co[2], uv2co[2], uv3co[2], uv[2]; @@ -2402,7 +2402,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface) } /* - * When base loop is over convert found neighbour indexes to real ones + * When base loop is over convert found neighbor indexes to real ones * Also count the final number of active surface points */ for (ty = 0; ty < h; ty++) @@ -2450,7 +2450,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface) for (i=0; i<8; i++) { - /* Try to find a neighbouring pixel in defined direction + /* Try to find a neighboring pixel in defined direction * If not found, -1 is returned */ int n_target = dynamicPaint_findNeighbourPixel(tempPoints, dm, uvname, w, h, tx, ty, i); @@ -3948,7 +3948,7 @@ void surface_determineForceTargetPoints(PaintSurfaceData *sData, int index, floa if (n_index == closest_id[0]) continue; - /* only accept neighbour at "other side" of the first one in relation to force dir + /* only accept neighbor at "other side" of the first one in relation to force dir * so make sure angle between this and closest neigh is greater than first angle */ if (dir_dot>closest_d[1] && closest_dot<closest_d[0] && dir_dot>0.0f) {closest_d[1]=dir_dot; closest_id[1]=n_index;} } @@ -3983,7 +3983,7 @@ void surface_determineForceTargetPoints(PaintSurfaceData *sData, int index, floa closest_d[1] *= acosf(temp)/1.57079633f; } else { - /* if only single neighbour, still linearize force intersection effect */ + /* if only single neighbor, still linearize force intersection effect */ closest_d[0] = 1.0f - acosf(closest_d[0])/1.57079633f; } } @@ -4177,7 +4177,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force /* Only reads values from the surface copy (prevPoint[]), * so this one is thread safe */ - /* Loop through neighbouring points */ + /* Loop through neighboring points */ for (i=0; i<numOfNeighs; i++) { int n_index = sData->adj_data->n_index[index]+i; float w_factor; @@ -4226,7 +4226,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force totalAlpha += ePoint->e_alpha; - /* Check if neighbouring point has lower alpha, + /* Check if neighboring point has lower alpha, * if so, decrease this point's alpha as well*/ if (pPoint->alpha <= 0.0f && pPoint->e_alpha <= 0.0f && pPoint->wetness <= 0.0f) continue; diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index f73a2ff6c1a..139f7d55438 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -47,9 +47,9 @@ #include "BKE_paint.h" +#include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" -#include "DNA_curve_types.h" /* for Curve */ #include "MEM_guardedalloc.h" @@ -75,7 +75,7 @@ BMEditMesh *BMEdit_Create(BMesh *bm, int do_tesselate) tm->bm = bm; if (do_tesselate) { - BMEdit_RecalcTesselation(tm); + BMEdit_RecalcTessellation(tm); } return tm; @@ -90,12 +90,12 @@ BMEditMesh *BMEdit_Copy(BMEditMesh *tm) tm2->bm = BM_mesh_copy(tm->bm); - /*The tesselation is NOT calculated on the copy here, + /*The tessellation is NOT calculated on the copy here, because currently all the callers of this function use it to make a backup copy of the BMEditMesh to restore it in the case of errors in an operation. For perf reasons, in that case it makes more sense to do the - tesselation only when/if that copy ends up getting + tessellation only when/if that copy ends up getting used.*/ tm2->looptris = NULL; @@ -106,7 +106,7 @@ BMEditMesh *BMEdit_Copy(BMEditMesh *tm) return tm2; } -static void BMEdit_RecalcTesselation_intern(BMEditMesh *tm) +static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm) { /* use this to avoid locking pthread for _every_ polygon * and calling the fill function */ @@ -245,21 +245,21 @@ static void BMEdit_RecalcTesselation_intern(BMEditMesh *tm) } -void BMEdit_RecalcTesselation(BMEditMesh *em) +void BMEdit_RecalcTessellation(BMEditMesh *em) { - BMEdit_RecalcTesselation_intern(em); + BMEdit_RecalcTessellation_intern(em); /* commented because editbmesh_build_data() ensures we get tessfaces */ #if 0 if (em->derivedFinal && em->derivedFinal == em->derivedCage) { - if (em->derivedFinal->recalcTesselation) - em->derivedFinal->recalcTesselation(em->derivedFinal); + if (em->derivedFinal->recalcTessellation) + em->derivedFinal->recalcTessellation(em->derivedFinal); } else if (em->derivedFinal) { - if (em->derivedCage->recalcTesselation) - em->derivedCage->recalcTesselation(em->derivedCage); - if (em->derivedFinal->recalcTesselation) - em->derivedFinal->recalcTesselation(em->derivedFinal); + if (em->derivedCage->recalcTessellation) + em->derivedCage->recalcTessellation(em->derivedCage); + if (em->derivedFinal->recalcTessellation) + em->derivedFinal->recalcTessellation(em->derivedFinal); } #endif } @@ -314,13 +314,13 @@ void BMEdit_Free(BMEditMesh *em) ok, basic design: the bmesh derivedmesh exposes the mesh as triangles. it stores pointers -to three loops per triangle. the derivedmesh stores a cache of tesselations +to three loops per triangle. the derivedmesh stores a cache of tessellations for each face. this cache will smartly update as needed (though at first it'll simply be more brute force). keeping track of face/edge counts may be a small problbm. this won't be the most efficient thing, considering that internal edges and -faces of tesselations are exposed. looking up an edge by index in particular +faces of tessellations are exposed. looking up an edge by index in particular is likely to be a little slow. */ @@ -345,7 +345,7 @@ static void emDM_calcNormals(DerivedMesh *UNUSED(dm)) BMVerts and BMFaces */ } -static void emDM_recalcTesselation(DerivedMesh *UNUSED(dm)) +static void emDM_recalcTessellation(DerivedMesh *UNUSED(dm)) { /* do nothing */ } @@ -1635,7 +1635,7 @@ DerivedMesh *getEditDerivedBMesh( bmdm->dm.getTessFaceDataArray = emDM_getTessFaceDataArray; bmdm->dm.calcNormals = emDM_calcNormals; - bmdm->dm.recalcTesselation = emDM_recalcTesselation; + bmdm->dm.recalcTessellation = emDM_recalcTessellation; bmdm->dm.foreachMappedVert = emDM_foreachMappedVert; bmdm->dm.foreachMappedEdge = emDM_foreachMappedEdge; @@ -1707,3 +1707,15 @@ DerivedMesh *getEditDerivedBMesh( return (DerivedMesh*) bmdm; } + +/** + * \brief Return the BMEditMesh for a given object + * + * \note this function assumes this is a mesh object, + * don't add NULL data check here. caller must do that + */ +BMEditMesh *BMEdit_FromObject(Object *ob) +{ + BLI_assert(ob->type == OB_MESH); + return ((Mesh *) ob->data )->edit_btmesh; +} diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index fa20db0fe72..1c6c229d8fc 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -362,7 +362,7 @@ int binarysearch_bezt_index (BezTriple array[], float frame, int arraylen, short int start=0, end=arraylen; int loopbreaker= 0, maxloop= arraylen * 2; - /* initialise replace-flag first */ + /* initialize replace-flag first */ *replace= 0; /* sneaky optimisations (don't go through searching process if...): diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 8098706e370..19b036d9ccf 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -99,7 +99,7 @@ static FModifierTypeInfo FMI_MODNAME = { /* Generators available: * 1) simple polynomial generator: * - Exanded form - (y = C[0]*(x^(n)) + C[1]*(x^(n-1)) + ... + C[n]) - * - Factorised form - (y = (C[0][0]*x + C[0][1]) * (C[1][0]*x + C[1][1]) * ... * (C[n][0]*x + C[n][1])) + * - Factorized form - (y = (C[0][0]*x + C[0][1]) * (C[1][0]*x + C[1][1]) * ... * (C[n][0]*x + C[n][1])) */ static void fcm_generator_free (FModifier *fcm) @@ -198,7 +198,7 @@ static void fcm_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float * { FMod_Generator *data= (FMod_Generator *)fcm->data; - /* behaviour depends on mode + /* behavior depends on mode * NOTE: the data in its default state is fine too */ switch (data->mode) { @@ -238,7 +238,7 @@ static void fcm_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float * } break; - case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* factorised polynomial */ + case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* Factorized polynomial */ { float value= 1.0f, *cp=NULL; unsigned int i; @@ -506,13 +506,15 @@ static FModifierTypeInfo FMI_ENVELOPE = { /* Cycles F-Curve Modifier --------------------------- */ /* This modifier changes evaltime to something that exists within the curve's frame-range, - * then re-evaluates modifier stack up to this point using the new time. This re-entrant behaviour - * is very likely to be more time-consuming than the original approach... (which was tighly integrated into + * then re-evaluates modifier stack up to this point using the new time. This re-entrant behavior + * is very likely to be more time-consuming than the original approach... (which was tightly integrated into * the calculation code...). * - * NOTE: this needs to be at the start of the stack to be of use, as it needs to know the extents of the keyframes/sample-data - * Possible TODO - store length of cycle information that can be initialised from the extents of the keyframes/sample-data, and adjusted - * as appropriate + * NOTE: this needs to be at the start of the stack to be of use, as it needs to know the extents of the + * keyframes/sample-data. + * + * Possible TODO - store length of cycle information that can be initialised from the extents of the + * keyframes/sample-data, and adjusted as appropriate. */ /* temp data used during evaluation */ @@ -955,7 +957,7 @@ static void fmods_init_typeinfo (void) */ FModifierTypeInfo *get_fmodifier_typeinfo (int type) { - /* initialise the type-info list? */ + /* initialize the type-info list? */ if (FMI_INIT) { fmods_init_typeinfo(); FMI_INIT = 0; @@ -1241,7 +1243,7 @@ static float eval_fmodifier_influence (FModifier *fcm, float evaltime) } /* evaluate time modifications imposed by some F-Curve Modifiers - * - this step acts as an optimisation to prevent the F-Curve stack being evaluated + * - this step acts as an optimization to prevent the F-Curve stack being evaluated * several times by modifiers requesting the time be modified, as the final result * would have required using the modified time * - modifiers only ever receive the unmodified time, as subsequent modifiers should be diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 093399832a1..5cef30894ef 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -608,7 +608,7 @@ IDProperty *IDP_GetProperties(ID *id, int create_if_needed) if (create_if_needed) { id->properties = MEM_callocN(sizeof(IDProperty), "IDProperty"); id->properties->type = IDP_GROUP; - /* dont overwite the data's name and type + /* dont overwrite the data's name and type * some functions might need this if they * dont have a real ID, should be named elsewhere - Campbell */ /* strcpy(id->name, "top_level_group");*/ diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 85982116165..ede3355951d 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1887,7 +1887,7 @@ int do_version_tface(Main *main, int fileload) ma->game.flag = -flag; /* some people uses multitexture with TexFace by creating a texture - * channel which not neccessarly the tf->tpage image. But the game engine + * channel which not necessarily the tf->tpage image. But the game engine * was enabling it. Now it's required to set "Face Texture [Alpha] in the * material settings. */ if (!fileload) diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index c9b73376a3d..23cda362f74 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -303,7 +303,7 @@ const char *mesh_cmp(Mesh *me1, Mesh *me2, float thresh) return NULL; } -static void mesh_ensure_tesselation_customdata(Mesh *me) +static void mesh_ensure_tessellation_customdata(Mesh *me) { const int tottex_original = CustomData_number_of_layers(&me->pdata, CD_MTEXPOLY); const int totcol_original = CustomData_number_of_layers(&me->ldata, CD_MLOOPCOL); @@ -322,7 +322,7 @@ static void mesh_ensure_tesselation_customdata(Mesh *me) * first time from bmesh, rather then giving a warning about this we could be smarter * and check if there was any data to begin with, for now just print the warning with * some info to help troubleshoot whats going on - campbell */ - printf("%s: warning! Tesselation uvs or vcol data got out of sync, " + printf("%s: warning! Tessellation uvs or vcol data got out of sync, " "had to reset!\n CD_MTFACE: %d != CD_MTEXPOLY: %d || CD_MCOL: %d != CD_MLOOPCOL: %d\n", __func__, tottex_tessface, tottex_original, totcol_tessface, totcol_original); } @@ -340,7 +340,7 @@ static void mesh_update_linked_customdata(Mesh *me, const short do_ensure_tess_c BMEdit_UpdateLinkedCustomData(me->edit_btmesh); if (do_ensure_tess_cd) { - mesh_ensure_tesselation_customdata(me); + mesh_ensure_tessellation_customdata(me); } CustomData_bmesh_update_active_layers(&me->fdata, &me->pdata, &me->ldata); @@ -526,7 +526,7 @@ BMesh *BKE_mesh_to_bmesh(Mesh *me, Object *ob) { BMesh *bm; - bm = BM_mesh_create(ob, bm_mesh_allocsize_default); + bm = BM_mesh_create(ob, &bm_mesh_allocsize_default); BMO_op_callf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%b", me, ob, TRUE); @@ -1688,7 +1688,7 @@ void mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts, } else { /* eek, we're not corresponding to polys */ - printf("error in mesh_calc_normals; tesselation face indices are incorrect. normals may look bad.\n"); + printf("error in mesh_calc_normals; tessellation face indices are incorrect. normals may look bad.\n"); } } } @@ -2185,10 +2185,10 @@ void mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata, } /* - this function recreates a tesselation. - returns number of tesselation faces. + this function recreates a tessellation. + returns number of tessellation faces. */ -int mesh_recalcTesselation(CustomData *fdata, +int mesh_recalcTessellation(CustomData *fdata, CustomData *ldata, CustomData *pdata, MVert *mvert, int totface, int UNUSED(totloop), int totpoly, @@ -2343,7 +2343,7 @@ int mesh_recalcTesselation(CustomData *fdata, mf->flag = mp->flag; #ifdef USE_TESSFACE_SPEEDUP - mf->edcode |= TESSFACE_SCANFILL; /* tag for sorting loop indicies */ + mf->edcode |= TESSFACE_SCANFILL; /* tag for sorting loop indices */ #endif if (poly_orig_index) { @@ -2467,8 +2467,8 @@ int mesh_recalcTesselation(CustomData *fdata, #ifdef USE_BMESH_SAVE_AS_COMPAT /* - * this function recreates a tesselation. - * returns number of tesselation faces. + * this function recreates a tessellation. + * returns number of tessellation faces. */ int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata, int totface, int UNUSED(totloop), int totpoly) @@ -2946,7 +2946,7 @@ void BKE_mesh_ensure_navmesh(Mesh *me) void BKE_mesh_tessface_calc(Mesh *mesh) { - mesh->totface = mesh_recalcTesselation(&mesh->fdata, &mesh->ldata, &mesh->pdata, + mesh->totface = mesh_recalcTessellation(&mesh->fdata, &mesh->ldata, &mesh->pdata, mesh->mvert, mesh->totface, mesh->totloop, mesh->totpoly, /* calc normals right after, dont copy from polys here */ diff --git a/source/blender/blenkernel/intern/modifiers_bmesh.c b/source/blender/blenkernel/intern/modifiers_bmesh.c index 6bca40be1e2..da8af1357ab 100644 --- a/source/blender/blenkernel/intern/modifiers_bmesh.c +++ b/source/blender/blenkernel/intern/modifiers_bmesh.c @@ -143,8 +143,12 @@ BMEditMesh *DM_to_editbmesh(Object *ob, DerivedMesh *dm, BMEditMesh *existing, i BMEditMesh *em = existing; BMesh *bm; - if (em) bm = em->bm; - else bm = BM_mesh_create(ob, bm_mesh_allocsize_default); + if (em) { + bm = em->bm; + } + else { + bm = BM_mesh_create(ob, &bm_mesh_allocsize_default); + } DM_to_bmesh_ex(dm, bm); @@ -153,7 +157,7 @@ BMEditMesh *DM_to_editbmesh(Object *ob, DerivedMesh *dm, BMEditMesh *existing, i } else { if (do_tesselate) { - BMEdit_RecalcTesselation(em); + BMEdit_RecalcTessellation(em); } } @@ -164,7 +168,7 @@ BMesh *DM_to_bmesh(Object *ob, DerivedMesh *dm) { BMesh *bm; - bm = BM_mesh_create(ob, bm_mesh_allocsize_default); + bm = BM_mesh_create(ob, &bm_mesh_allocsize_default); DM_to_bmesh_ex(dm, bm); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index a6795ed3a7d..814f0715d11 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -286,7 +286,7 @@ NlaStrip *add_nlastrip (bAction *act) * - selected flag to highlight this to the user * - auto-blends to ensure that blend in/out values are automatically * determined by overlaps of strips - * - (XXX) synchronisation of strip-length in accordance with changes to action-length + * - (XXX) synchronization of strip-length in accordance with changes to action-length * is not done though, since this should only really happens in editmode for strips now * though this decision is still subject to further review... */ @@ -778,7 +778,7 @@ short BKE_nlameta_add_strip (NlaStrip *mstrip, NlaStrip *strip) return 0; /* check if this would need to be added to the ends of the meta, - * and subsequently, if the neighbouring strips allow us enough room + * and subsequently, if the neighboring strips allow us enough room */ if (strip->start < mstrip->start) { /* check if strip to the left (if it exists) ends before the @@ -841,7 +841,7 @@ void BKE_nlameta_flush_transforms (NlaStrip *mstrip) oEnd= ((NlaStrip *)mstrip->strips.last)->end; offset= mstrip->start - oStart; - /* optimisation: + /* optimization: * don't flush if nothing changed yet * TODO: maybe we need a flag to say always flush? */ @@ -1018,7 +1018,7 @@ short BKE_nlatrack_get_bounds (NlaTrack *nlt, float bounds[2]) { NlaStrip *strip; - /* initialise bounds */ + /* initialize bounds */ if (bounds) bounds[0] = bounds[1] = 0.0f; else @@ -1235,7 +1235,7 @@ void BKE_nlastrip_validate_fcurves (NlaStrip *strip) /* store path - make copy, and store that */ fcu->rna_path= BLI_strdupn("influence", 9); - // TODO: insert a few keyframes to ensure default behaviour? + // TODO: insert a few keyframes to ensure default behavior? } } @@ -1256,7 +1256,7 @@ void BKE_nlastrip_validate_fcurves (NlaStrip *strip) /* store path - make copy, and store that */ fcu->rna_path= BLI_strdupn("strip_time", 10); - // TODO: insert a few keyframes to ensure default behaviour? + // TODO: insert a few keyframes to ensure default behavior? } } } diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index c394a5354f1..f9817d5b6f5 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -903,12 +903,15 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node) node_unlink_attached(ntree, node); BLI_remlink(&ntree->nodes, node); - + /* since it is called while free database, node->id is undefined */ if (treetype->free_node_cache) treetype->free_node_cache(ntree, node); + if(node->typeinfo && node->typeinfo->freestoragefunc) + node->typeinfo->freestoragefunc(node); + for (sock=node->inputs.first; sock; sock = nextsock) { nextsock = sock->next; node_socket_free_default_value(sock->type, sock->default_value); @@ -922,10 +925,6 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node) nodeFreePreview(node); - if(node->typeinfo && node->typeinfo->freestoragefunc) { - node->typeinfo->freestoragefunc(node); - } - MEM_freeN(node); ntree->update |= NTREE_UPDATE_NODES; @@ -992,7 +991,7 @@ void ntreeSetOutput(bNodeTree *ntree) { bNode *node; - /* find the active outputs, might become tree type dependant handler */ + /* find the active outputs, might become tree type dependent handler */ for(node= ntree->nodes.first; node; node= node->next) { if(node->typeinfo->nclass==NODE_CLASS_OUTPUT) { bNode *tnode; @@ -1369,6 +1368,19 @@ int nodeSocketIsHidden(bNodeSocket *sock) return ((sock->flag & (SOCK_HIDDEN | SOCK_AUTO_HIDDEN | SOCK_UNAVAIL)) != 0); } +void nodeSocketSetType(bNodeSocket *sock, int type) +{ + int old_type = sock->type; + void *old_default_value = sock->default_value; + + sock->type = type; + + sock->default_value = node_socket_make_default_value(sock->type); + node_socket_init_default_value(type, sock->default_value); + node_socket_convert_default_value(sock->type, sock->default_value, old_type, old_default_value); + node_socket_free_default_value(old_type, old_default_value); +} + /* ************** dependency stuff *********** */ /* node is guaranteed to be not checked before */ @@ -1839,7 +1851,6 @@ static void registerCompositNodes(bNodeTreeType *ttype) register_node_type_cmp_viewer(ttype); register_node_type_cmp_splitviewer(ttype); register_node_type_cmp_output_file(ttype); - register_node_type_cmp_output_multi_file(ttype); register_node_type_cmp_view_levels(ttype); register_node_type_cmp_curve_rgb(ttype); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 74c996e9516..3e55e58a71d 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2537,7 +2537,7 @@ void object_handle_update(Scene *scene, Object *ob) case OB_MESH: { #if 0 // XXX, comment for 2.56a release, background wont set 'scene->customdata_mask' - BMEditMesh *em = (ob == scene->obedit)? ((Mesh*)ob->data)->edit_btmesh : NULL; + BMEditMesh *em = (ob == scene->obedit) ? BMEdit_FromObject(ob) : NULL; BLI_assert((scene->customdata_mask & CD_MASK_BAREMESH) == CD_MASK_BAREMESH); if (em) { makeDerivedMesh(scene, ob, em, scene->customdata_mask, 0); /* was CD_MASK_BAREMESH */ @@ -2547,7 +2547,7 @@ void object_handle_update(Scene *scene, Object *ob) } #else /* ensure CD_MASK_BAREMESH for now */ - BMEditMesh *em = (ob == scene->obedit)? ((Mesh*)ob->data)->edit_btmesh : NULL; + BMEditMesh *em = (ob == scene->obedit) ? BMEdit_FromObject(ob) : NULL; uint64_t data_mask= scene->customdata_mask | ob->customdata_mask | CD_MASK_BAREMESH; if (em) { makeDerivedMesh(scene, ob, em, data_mask, 0); /* was CD_MASK_BAREMESH */ diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index 00a66edc2b4..65db275b61f 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -170,7 +170,7 @@ static float gaussRand (void) } /** - * Som usefull functions + * Some useful functions * */ MINLINE float lerp(float a,float b,float f) { diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 2e91d76cf21..33e2c2376a3 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -2874,10 +2874,12 @@ static void cache_key_incremental_rotation(ParticleCacheKey *key0, ParticleCache copy_v3_v3(prev_tangent, tangent); } } -/* Calculates paths ready for drawing/rendering. */ -/* -Usefull for making use of opengl vertex arrays for super fast strand drawing. */ -/* -Makes child strands possible and creates them too into the cache. */ -/* -Cached path data is also used to determine cut position for the editmode tool. */ + +/** + * Calculates paths ready for drawing/rendering + * - Useful for making use of opengl vertex arrays for super fast strand drawing. + * - Makes child strands possible and creates them too into the cache. + * - Cached path data is also used to determine cut position for the editmode tool. */ void psys_cache_paths(ParticleSimulationData *sim, float cfra) { PARTICLE_PSMD; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 206d9036ba7..e4800ac25a3 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -974,7 +974,7 @@ static int distribute_compare_orig_index(const void *p1, const void *p2) return -1; else if(index1 == index2) { /* this pointer comparison appears to make qsort stable for glibc, - * and apparently on solaris too, makes the renders reproducable */ + * and apparently on solaris too, makes the renders reproducible */ if(p1 < p2) return -1; else if(p1 == p2) diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index e9aea36b1f1..59394d1088d 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -669,7 +669,7 @@ int next_object(Scene **scene, int val, Base **base, Object **ob) /* XXX particle systems with metas+dupligroups call this recursively */ /* see bug #18725 */ if (in_next_object) { - printf("ERROR: MetaBall generation called recursively, not supported\n"); + printf("ERROR: Metaball generation called recursively, not supported\n"); return F_ERROR; } diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 84513f83204..efc3477298c 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -287,7 +287,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) BVHTreeRayHit hit; BVHTreeFromMesh treeData= NULL_BVHTreeFromMesh; - //auxiliar target + //auxiliary target DerivedMesh *auxMesh = NULL; BVHTreeFromMesh auxData = NULL_BVHTreeFromMesh; SpaceTransform local2aux; @@ -306,7 +306,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) else { //The code supports any axis that is a combination of X,Y,Z - //altought currently UI only allows to set the 3 diferent axis + //although currently UI only allows to set the 3 different axis if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) proj_axis[0] = 1.0f; if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) proj_axis[1] = 1.0f; if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) proj_axis[2] = 1.0f; @@ -405,7 +405,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) * Shrinkwrap moving vertexs to the nearest surface point on the target * * it builds a BVHTree from the target mesh and then performs a - * NN matchs for each vertex + * NN matches for each vertex */ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) { diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index e7dbbf44223..8f0fcc04e1e 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -1163,7 +1163,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd) for(z = 0; z < sds->res[2]; z++) { - // neighbour cell emission densities (for high resolution smoke smooth interpolation) + // neighbor cell emission densities (for high resolution smoke smooth interpolation) float c000, c001, c010, c011, c100, c101, c110, c111; c000 = (x>0 && y>0 && z>0) ? temp_emission_map[smoke_get_index(x-1, sds->res[0], y-1, sds->res[1], z-1)] : 0; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 063a274715c..4f48fb0270f 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -860,7 +860,7 @@ static void renew_softbody(Scene *scene, Object *ob, int totpoint, int totspring if (totspring) sb->bspring= MEM_mallocN( totspring*sizeof(BodySpring), "bodyspring"); - /* initialise BodyPoint array */ + /* initialize BodyPoint array */ for (i=0; i<totpoint; i++) { BodyPoint *bp = &sb->bpoint[i]; @@ -988,7 +988,7 @@ static void Vec3PlusStVec(float *v, float s, float *v1) v[2] += s*v1[2]; } -/* +++ dependancy information functions*/ +/* +++ dependency information functions*/ static int are_there_deflectors(Scene *scene, unsigned int layer) { @@ -1007,7 +1007,7 @@ static int query_external_colliders(Scene *scene, Object *me) { return(are_there_deflectors(scene, me->lay)); } -/* --- dependancy information functions*/ +/* --- dependency information functions*/ /* +++ the aabb "force" section*/ @@ -1606,7 +1606,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow, } f = normalize_v3(vel); f = -0.0001f*f*f*sb->aeroedge; - /* (todo) add a nice angle dependant function done for now BUT */ + /* (todo) add a nice angle dependent function done for now BUT */ /* still there could be some nice drag/lift function, but who needs it */ sub_v3_v3v3(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos); diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 9f573397837..190ad07db6a 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -2858,7 +2858,7 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm) return ccgdm->pbvh; } -static void ccgDM_recalcTesselation(DerivedMesh *UNUSED(dm)) +static void ccgDM_recalcTessellation(DerivedMesh *UNUSED(dm)) { /* Nothing to do: CCG handles creating its own tessfaces */ } @@ -2967,7 +2967,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, ccgdm->dm.copyTessFaceArray = ccgDM_copyFinalFaceArray; ccgdm->dm.calcNormals = ccgDM_calcNormals; - ccgdm->dm.recalcTesselation = ccgDM_recalcTesselation; + ccgdm->dm.recalcTessellation = ccgDM_recalcTessellation; ccgdm->dm.getVertCos = ccgdm_getVertCos; ccgdm->dm.foreachMappedVert = ccgDM_foreachMappedVert; @@ -3343,7 +3343,7 @@ struct DerivedMesh *subsurf_make_derived_from_derived( CCGSubSurf *ss; /* It is quite possible there is a much better place to do this. It - * depends a bit on how rigourously we expect this function to never + * depends a bit on how rigorously we expect this function to never * be called in editmode. In semi-theory we could share a single * cache, but the handles used inside and outside editmode are not * the same so we would need some way of converting them. Its probably diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 888d59b78b5..8e3ec4766e9 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -90,7 +90,7 @@ be popped ... other st's retain their own top location. Markers -- -The mrk->flags define the behaviour and relationships between markers. The +The mrk->flags define the behavior and relationships between markers. The upper two bytes are used to hold a group ID, the lower two are normal flags. If TMARK_EDITALL is set the group ID defines which other markers should be edited. @@ -2617,7 +2617,7 @@ void txt_backspace_word (Text *text) } /* Max spaces to replace a tab with, currently hardcoded to TXT_TABSIZE = 4. - * Used by txt_convert_tab_to_spaces, indent and unintent. + * Used by txt_convert_tab_to_spaces, indent and unindent. * Remember to change this string according to max tab size */ static char tab_to_spaces[] = " "; diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index ede2eb7f461..4a509473ac8 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -944,7 +944,7 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u float log2_search_to_pattern_ratio = log(floor(search_to_pattern_ratio)) / M_LN2; int max_pyramid_levels= floor(log2_search_to_pattern_ratio + 1); - /* try to accomodate the user's choice of pyramid level in a way + /* try to accommodate the user's choice of pyramid level in a way * that doesn't cause the coarsest pyramid pattern to be larger * than the search size */ int level= MIN2(track->pyramid_levels, max_pyramid_levels); diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h index 9fa66e91393..a8a7cf39066 100644 --- a/source/blender/blenlib/BLI_array.h +++ b/source/blender/blenlib/BLI_array.h @@ -51,7 +51,7 @@ * * arrays are buffered, using double-buffering (so on each reallocation, * the array size is doubled). supposedly this should give good Big Oh - * behaviour, though it may not be the best in practice. + * behavior, though it may not be the best in practice. */ #define BLI_array_declare(arr) \ diff --git a/source/blender/blenlib/BLI_dlrbTree.h b/source/blender/blenlib/BLI_dlrbTree.h index f048e319d5d..e8765e699c8 100644 --- a/source/blender/blenlib/BLI_dlrbTree.h +++ b/source/blender/blenlib/BLI_dlrbTree.h @@ -77,7 +77,7 @@ typedef struct DLRBT_Tree { /* return -1, 0, 1 for whether the given data is less than, equal to, or greater than the given node * - node: <DLRBT_Node> the node to compare to - * - data: pointer to the relevant data or values stored in the bitpattern dependant on the function + * - data: pointer to the relevant data or values stored in the bitpattern dependent on the function */ typedef short (*DLRBT_Comparator_FP)(void *node, void *data); @@ -88,7 +88,7 @@ typedef DLRBT_Node *(*DLRBT_NAlloc_FP)(void *data); /* update an existing node instance accordingly to be in sync with the given data * * - node: <DLRBT_Node> the node to update - * - data: pointer to the relevant data or values stored in the bitpattern dependant on the function + * - data: pointer to the relevant data or values stored in the bitpattern dependent on the function */ typedef void (*DLRBT_NUpdate_FP)(void *node, void *data); @@ -97,7 +97,7 @@ typedef void (*DLRBT_NUpdate_FP)(void *node, void *data); /* ADT Management ------------------------------- */ -/* Create a new tree, and initialise as necessary */ +/* Create a new tree, and initialize as necessary */ DLRBT_Tree *BLI_dlrbTree_new(void); /* Initialises some given trees */ diff --git a/source/blender/blenlib/BLI_dynstr.h b/source/blender/blenlib/BLI_dynstr.h index 6b499c3bbcf..e6a2bb45a68 100644 --- a/source/blender/blenlib/BLI_dynstr.h +++ b/source/blender/blenlib/BLI_dynstr.h @@ -48,32 +48,32 @@ typedef struct DynStr DynStr; /** * Create a new DynStr. * - * @return Pointer to a new DynStr. + * \return Pointer to a new DynStr. */ DynStr* BLI_dynstr_new (void); /** * Append a c-string to a DynStr. * - * @param ds The DynStr to append to. - * @param cstr The c-string to append. + * \param ds The DynStr to append to. + * \param cstr The c-string to append. */ void BLI_dynstr_append (DynStr *ds, const char *cstr); /** * Append a length clamped c-string to a DynStr. * - * @param ds The DynStr to append to. - * @param cstr The c-string to append. - * @param len The maximum length of the c-string to copy. + * \param ds The DynStr to append to. + * \param cstr The c-string to append. + * \param len The maximum length of the c-string to copy. */ void BLI_dynstr_nappend (DynStr *ds, const char *cstr, int len); /** * Append a c-string to a DynStr, but with formatting like printf. * - * @param ds The DynStr to append to. - * @param format The printf format string to use. + * \param ds The DynStr to append to. + * \param format The printf format string to use. */ void BLI_dynstr_appendf (DynStr *ds, const char *format, ...) #ifdef __GNUC__ @@ -85,8 +85,8 @@ void BLI_dynstr_vappendf (DynStr *ds, const char *format, va_list args); /** * Find the length of a DynStr. * - * @param ds The DynStr of interest. - * @return The length of @a ds. + * \param ds The DynStr of interest. + * \return The length of \a ds. */ int BLI_dynstr_get_len (DynStr *ds); @@ -95,8 +95,8 @@ int BLI_dynstr_get_len (DynStr *ds); * <i> The returned c-string should be free'd * using MEM_freeN. </i> * - * @param ds The DynStr of interest. - * @return The contents of @a ds as a c-string. + * \param ds The DynStr of interest. + * \return The contents of \a ds as a c-string. */ char* BLI_dynstr_get_cstring (DynStr *ds); @@ -105,16 +105,16 @@ char* BLI_dynstr_get_cstring (DynStr *ds); * <i> The str argument must be allocated to be at * least the size of BLI_dynstr_get_len(ds) + 1. </i> * - * @param ds The DynStr of interest. - * @param str The string to fill. - * @return The contents of @a ds as a c-string. + * \param ds The DynStr of interest. + * \param str The string to fill. + * \return The contents of \a ds as a c-string. */ void BLI_dynstr_get_cstring_ex (DynStr *ds, char *str); /** * Free the DynStr * - * @param ds The DynStr to free. + * \param ds The DynStr to free. */ void BLI_dynstr_free (DynStr *ds); diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index ccad3250a5f..457f098bff7 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -80,8 +80,8 @@ int BLI_ghash_size (GHash *gh); * while the iterator is in use, and the iterator will step exactly * BLI_ghash_size(gh) times before becoming done. * - * @param gh The GHash to iterate over. - * @return Pointer to a new DynStr. + * \param gh The GHash to iterate over. + * \return Pointer to a new DynStr. */ GHashIterator* BLI_ghashIterator_new (GHash *gh); /** @@ -89,45 +89,45 @@ GHashIterator* BLI_ghashIterator_new (GHash *gh); * be mutated while the iterator is in use, and the iterator will * step exactly BLI_ghash_size(gh) times before becoming done. * - * @param ghi The GHashIterator to initialize. - * @param gh The GHash to iterate over. + * \param ghi The GHashIterator to initialize. + * \param gh The GHash to iterate over. */ void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh); /** * Free a GHashIterator. * - * @param ghi The iterator to free. + * \param ghi The iterator to free. */ void BLI_ghashIterator_free (GHashIterator *ghi); /** * Retrieve the key from an iterator. * - * @param ghi The iterator. - * @return The key at the current index, or NULL if the + * \param ghi The iterator. + * \return The key at the current index, or NULL if the * iterator is done. */ void* BLI_ghashIterator_getKey (GHashIterator *ghi); /** * Retrieve the value from an iterator. * - * @param ghi The iterator. - * @return The value at the current index, or NULL if the + * \param ghi The iterator. + * \return The value at the current index, or NULL if the * iterator is done. */ void* BLI_ghashIterator_getValue (GHashIterator *ghi); /** * Steps the iterator to the next index. * - * @param ghi The iterator. + * \param ghi The iterator. */ void BLI_ghashIterator_step (GHashIterator *ghi); /** * Determine if an iterator is done (has reached the end of * the hash table). * - * @param ghi The iterator. - * @return True if done, False otherwise. + * \param ghi The iterator. + * \return True if done, False otherwise. */ int BLI_ghashIterator_isDone (GHashIterator *ghi); diff --git a/source/blender/blenlib/BLI_graph.h b/source/blender/blenlib/BLI_graph.h index effa2c3bc03..52613f9869f 100644 --- a/source/blender/blenlib/BLI_graph.h +++ b/source/blender/blenlib/BLI_graph.h @@ -177,7 +177,7 @@ void BLI_mirrorAlongAxis(float v[3], float center[3], float axis[3]); /* BArc symmetry flags * - * axial symetry sides */ + * axial symmetry sides */ #define SYM_SIDE_POSITIVE 1 #define SYM_SIDE_NEGATIVE 2 /* Anything higher is the order in radial symmetry */ diff --git a/source/blender/blenlib/BLI_gsqueue.h b/source/blender/blenlib/BLI_gsqueue.h index 53fdb5a541a..0265cf9b639 100644 --- a/source/blender/blenlib/BLI_gsqueue.h +++ b/source/blender/blenlib/BLI_gsqueue.h @@ -39,8 +39,8 @@ typedef struct _GSQueue GSQueue; /** * Create a new GSQueue. * - * @param elem_size The size of the structures in the queue. - * @retval The new queue + * \param elem_size The size of the structures in the queue. + * \retval The new queue */ GSQueue* BLI_gsqueue_new (int elem_size); @@ -58,7 +58,7 @@ int BLI_gsqueue_size(GSQueue *gq); * Access the item at the head of the queue * without removing it. * - * @param item_r A pointer to an appropriatly + * \param item_r A pointer to an appropriatly * sized structure (the size passed to BLI_gsqueue_new) */ void BLI_gsqueue_peek (GSQueue *gq, void *item_r); @@ -67,7 +67,7 @@ void BLI_gsqueue_peek (GSQueue *gq, void *item_r); * Access the item at the head of the queue * and remove it. * - * @param item_r A pointer to an appropriatly + * \param item_r A pointer to an appropriatly * sized structure (the size passed to BLI_gsqueue_new). * Can be NULL if desired. */ @@ -76,7 +76,7 @@ void BLI_gsqueue_pop (GSQueue *gq, void *item_r); /** * Push an element onto the tail of the queue. * - * @param item A pointer to an appropriatly + * \param item A pointer to an appropriatly * sized structure (the size passed to BLI_gsqueue_new). */ void BLI_gsqueue_push (GSQueue *gq, void *item); @@ -85,7 +85,7 @@ void BLI_gsqueue_push (GSQueue *gq, void *item); * Push an element back onto the head of the queue (so * it would be returned from the next call to BLI_gsqueue_pop). * - * @param item A pointer to an appropriatly + * \param item A pointer to an appropriatly * sized structure (the size passed to BLI_gsqueue_new). */ void BLI_gsqueue_pushback (GSQueue *gq, void *item); diff --git a/source/blender/blenlib/BLI_kdtree.h b/source/blender/blenlib/BLI_kdtree.h index 0ec514b4480..a58f58020d7 100644 --- a/source/blender/blenlib/BLI_kdtree.h +++ b/source/blender/blenlib/BLI_kdtree.h @@ -31,7 +31,7 @@ /** \file BLI_kdtree.h * \ingroup bli - * \brief A kd-tree for nearest neighbour search. + * \brief A kd-tree for nearest neighbor search. * \author Janne Karhu * \author Brecht van Lommel */ diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index b46f79fb2e6..2a5543b10ed 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -111,12 +111,12 @@ int isect_ray_plane_v3(const float p1[3], const float d[3], /** * Intersect line/plane, optionally treat line as directional (like a ray) with the no_flip argument. - * @param out The intersection point. - * @param l1 The first point of the line. - * @param l2 The second point of the line. - * @param plane_co A point on the plane to intersect with. - * @param plane_no The direction of the plane (does not need to be normalized). - * @param no_flip When true, the intersection point will always be from l1 to l2, even if this is not on the plane. + * \param out The intersection point. + * \param l1 The first point of the line. + * \param l2 The second point of the line. + * \param plane_co A point on the plane to intersect with. + * \param plane_no The direction of the plane (does not need to be normalized). + * \param no_flip When true, the intersection point will always be from l1 to l2, even if this is not on the plane. */ int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], const float plane_co[3], const float plane_no[3], const short no_flip); @@ -125,12 +125,12 @@ int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], * Intersect two planes, return a point on the intersection and a vector * that runs on the direction of the intersection. * Return error code is the same as 'isect_line_line_v3'. - * @param r_isect_co The resulting intersection point. - * @param r_isect_no The resulting vector of the intersection. - * @param plane_a_co The point on the first plane. - * @param plane_a_no The normal of the first plane. - * @param plane_b_co The point on the second plane. - * @param plane_b_no The normal of the second plane. + * \param r_isect_co The resulting intersection point. + * \param r_isect_no The resulting vector of the intersection. + * \param plane_a_co The point on the first plane. + * \param plane_a_no The normal of the first plane. + * \param plane_b_co The point on the second plane. + * \param plane_b_no The normal of the second plane. */ void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3], const float plane_a_co[3], const float plane_a_no[3], diff --git a/source/blender/blenlib/BLI_mempool.h b/source/blender/blenlib/BLI_mempool.h index 0b190c63559..9d7c7d496c8 100644 --- a/source/blender/blenlib/BLI_mempool.h +++ b/source/blender/blenlib/BLI_mempool.h @@ -48,8 +48,7 @@ typedef struct BLI_mempool BLI_mempool; * first four bytes of the elements never contain the character string * 'free'. use with care.*/ -BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk, - short use_sysmalloc, short allow_iter); +BLI_mempool *BLI_mempool_create(int esize, int totelem, int pchunk, int flag); void *BLI_mempool_alloc(BLI_mempool *pool); void *BLI_mempool_calloc(BLI_mempool *pool); void BLI_mempool_free(BLI_mempool *pool, void *addr); @@ -65,6 +64,12 @@ typedef struct BLI_mempool_iter { int curindex; } BLI_mempool_iter; +/* flag */ +enum { + BLI_MEMPOOL_SYSMALLOC = (1 << 0), + BLI_MEMPOOL_ALLOW_ITER = (1 << 1) +}; + void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter); void *BLI_mempool_iterstep(BLI_mempool_iter *iter); diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index a2d432b492a..3ee548098ff 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -131,15 +131,15 @@ int BLI_has_parent(char *path); /** * Blender's path code replacement function. - * Bases @a path strings leading with "//" by the - * directory @a basepath, and replaces instances of - * '#' with the @a framenum. Results are written - * back into @a path. + * Bases \a path strings leading with "//" by the + * directory \a basepath, and replaces instances of + * '#' with the \a framenum. Results are written + * back into \a path. * - * @a path The path to convert - * @a basepath The directory to base relative paths with. - * @a framenum The framenumber to replace the frame code with. - * @retval Returns true if the path was relative (started with "//"). + * \a path The path to convert + * \a basepath The directory to base relative paths with. + * \a framenum The framenumber to replace the frame code with. + * \retval Returns true if the path was relative (started with "//"). */ int BLI_path_abs(char *path, const char *basepath); int BLI_path_frame(char *path, int frame, int digits); @@ -156,12 +156,12 @@ void BLI_path_rel(char *file, const char *relfile); #endif /** - * Change every @a from in @a string into @a to. The - * result will be in @a string + * Change every \a from in \a string into \a to. The + * result will be in \a string * - * @a string The string to work on - * @a from The character to replace - * @a to The character to replace with + * \a string The string to work on + * \a from The character to replace + * \a to The character to replace with */ void BLI_char_switch(char *string, char from, char to); diff --git a/source/blender/blenlib/BLI_rand.h b/source/blender/blenlib/BLI_rand.h index 1749bbcc38a..d4d6563ac99 100644 --- a/source/blender/blenlib/BLI_rand.h +++ b/source/blender/blenlib/BLI_rand.h @@ -68,8 +68,8 @@ double BLI_drand (void); /** Return a pseudo-random number N where 0.0f<=N<1.0f */ float BLI_frand (void); - /** Fills a block of memory starting at @a addr - * and extending @a len bytes with pseudo-random + /** Fills a block of memory starting at \a addr + * and extending \a len bytes with pseudo-random * contents. This routine does not use nor modify * the state of the BLI random number generator. */ diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h index 4ff203737a0..d1209524c15 100644 --- a/source/blender/blenlib/BLI_rect.h +++ b/source/blender/blenlib/BLI_rect.h @@ -46,7 +46,7 @@ extern "C" { * rect is one with a zero (or negative) * width or height. * - * @return True if @a rect is empty. + * \return True if \a rect is empty. */ int BLI_rcti_is_empty(struct rcti *rect); int BLI_rctf_is_empty(struct rctf *rect); diff --git a/source/blender/blenlib/BLI_scanfill.h b/source/blender/blenlib/BLI_scanfill.h index 1f0e455fa45..d497ffa4941 100644 --- a/source/blender/blenlib/BLI_scanfill.h +++ b/source/blender/blenlib/BLI_scanfill.h @@ -36,7 +36,7 @@ */ /** - * @attention Defined in scanfill.c + * \attention Defined in scanfill.c */ extern struct ListBase fillvertbase; extern struct ListBase filledgebase; @@ -94,8 +94,8 @@ void BLI_end_edgefill(void); /** * Set a function taking a char* as argument to flag errors. If the * callback is not set, the error is discarded. - * @param f The function to use as callback - * @attention used in creator.c + * \param f The function to use as callback + * \attention used in creator.c */ void BLI_setErrorCallBack(void (*f)(const char*)); @@ -104,8 +104,8 @@ void BLI_setErrorCallBack(void (*f)(const char*)); * in this module. If the function returns true, the execution will * terminate gracefully. If the callback is not set, interruption is * not possible. - * @param f The function to use as callback - * @attention used in creator.c + * \param f The function to use as callback + * \attention used in creator.c */ void BLI_setInterruptCallBack(int (*f)(void)); diff --git a/source/blender/blenlib/BLI_sparsemap.h b/source/blender/blenlib/BLI_sparsemap.h deleted file mode 100644 index 654cafbc200..00000000000 --- a/source/blender/blenlib/BLI_sparsemap.h +++ /dev/null @@ -1,81 +0,0 @@ -#if 0 -/* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung - * All rights reserved. - * - * Contributor(s): Joseph Eagar (original author) - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef __BLI_SPARSEMAP_H__ -#define __BLI_SPARSEMAP_H__ - -/** \file BLI_sparsemap.h - * \ingroup bli - */ - -#include "BLI_math_inline.h" - -typedef struct SparseMap { - int max; - int blocksize; - void **blocks; - int totblock; -} SparseMap; - -MALWAYS_INLINE SparseMap *BLI_sparsemap_new(int blocksize, char *name) -{ - SparseMap *sm = MEM_callocN(sizeof(SparseMap), name); - - sm->blocksize = blocksize; - return sm; -} - -MALWAYS_INLINE void BLI_sparsemap_free(SparseMap *sm) -{ - if (sm->blocks) - MEM_freeN(sm->blocks); - - MEM_freeN(sm); -} - -MALWAYS_INLINE void BLI_sparsemap_set(SparseMap *sm, int index, void *ptr) -{ - if (index >= sm->max || (sm->blocks && !sm->blocks[index/sm->blocksize])) { - int totblock = MAX2((index+1)/sm->blocksize, 2); - void *blocks = MEM_callocN(sizeof(void*)*totblock); - - if (sm->blocks) - memcpy(blocks, sm->blocks, sizeof(void*)*sm->totblock); - sm->totblock = totblock; - MEM_freeN(sm->blocks); - sm->blocks = blocks; - } - - if (!sm->blocks[index/sm->blocksize]) { - sm->blocks[index/sm->blocksize] = MEM_mallocN(sizeof(void*)*sm->blocksize); - } - - sm->blocks[index/sm->blocksize] = ptr; -} - -#endif /* __BLI_SPARSEMAP_H__ */ - -#endif diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index 25eb2ebecc2..ec36d587d92 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -37,30 +37,30 @@ extern "C" { #endif /** - * Duplicates the cstring @a str into a newly mallocN'd + * Duplicates the cstring \a str into a newly mallocN'd * string and returns it. * - * @param str The string to be duplicated - * @retval Returns the duplicated string + * \param str The string to be duplicated + * \retval Returns the duplicated string */ char *BLI_strdup(const char *str); /** - * Duplicates the first @a len bytes of cstring @a str - * into a newly mallocN'd string and returns it. @a str + * Duplicates the first \a len bytes of cstring \a str + * into a newly mallocN'd string and returns it. \a str * is assumed to be at least len bytes long. * - * @param str The string to be duplicated - * @param len The number of bytes to duplicate - * @retval Returns the duplicated string + * \param str The string to be duplicated + * \param len The number of bytes to duplicate + * \retval Returns the duplicated string */ char *BLI_strdupn(const char *str, const size_t len); /** * Appends the two strings, and returns new mallocN'ed string - * @param str1 first string for copy - * @param str2 second string for append - * @retval Returns dst + * \param str1 first string for copy + * \param str2 second string for append + * \retval Returns dst */ char *BLI_strdupcat(const char *str1, const char *str2); @@ -68,11 +68,11 @@ char *BLI_strdupcat(const char *str1, const char *str2); * Like strncpy but ensures dst is always * '\0' terminated. * - * @param dst Destination for copy - * @param src Source string to copy - * @param maxncpy Maximum number of characters to copy (generally + * \param dst Destination for copy + * \param src Source string to copy + * \param maxncpy Maximum number of characters to copy (generally * the size of dst) - * @retval Returns dst + * \retval Returns dst */ char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy); @@ -88,14 +88,14 @@ char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy); char *BLI_getQuotedStr(const char *str, const char *prefix); /** - * Returns a copy of the cstring @a str into a newly mallocN'd + * Returns a copy of the cstring \a str into a newly mallocN'd * string with all instances of oldText replaced with newText, * and returns it. * - * @param str The string to replace occurances of oldText in - * @param oldText The text in the string to find and replace - * @param newText The text in the string to find and replace - * @retval Returns the duplicated string + * \param str The string to replace occurrences of oldText in + * \param oldText The text in the string to find and replace + * \param newText The text in the string to find and replace + * \retval Returns the duplicated string */ char *BLI_replacestr(char *str, const char *oldText, const char *newText); @@ -123,7 +123,7 @@ size_t BLI_strescape(char *dst, const char *src, const size_t maxlen); /** * Compare two strings without regard to case. * - * @retval True if the strings are equal, false otherwise. + * \retval True if the strings are equal, false otherwise. */ int BLI_strcaseeq(const char *a, const char *b); diff --git a/source/blender/blenlib/BLI_vfontdata.h b/source/blender/blenlib/BLI_vfontdata.h index 5f7b7c39036..0020ba308af 100644 --- a/source/blender/blenlib/BLI_vfontdata.h +++ b/source/blender/blenlib/BLI_vfontdata.h @@ -70,8 +70,8 @@ struct TmpFont * Construct a new VFontData structure from * Freetype font data in a PackedFile. * - * @param pf The font data. - * @retval A new VFontData structure, or NULL + * \param pf The font data. + * \retval A new VFontData structure, or NULL * if unable to load. */ VFontData* diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt index dc70a59ed6e..f442c0e8ae7 100644 --- a/source/blender/blenlib/CMakeLists.txt +++ b/source/blender/blenlib/CMakeLists.txt @@ -93,7 +93,6 @@ set(SRC BLI_array.h BLI_bitmap.h BLI_smallhash.h - BLI_sparsemap.h BLI_args.h BLI_blenlib.h BLI_boxpack2d.h diff --git a/source/blender/blenlib/PIL_time.h b/source/blender/blenlib/PIL_time.h index fa2ad8644e9..7d34d33d686 100644 --- a/source/blender/blenlib/PIL_time.h +++ b/source/blender/blenlib/PIL_time.h @@ -42,14 +42,14 @@ extern "C" { extern /** Return an indication of time, expressed as * seconds since some fixed point. Successive calls - * are guarenteed to generate values greator than or + * are guaranteed to generate values greater than or * equal to the last call. */ double PIL_check_seconds_timer (void); /** * Platform-independent sleep function. - * @param ms Number of milliseconds to sleep + * \param ms Number of milliseconds to sleep */ void PIL_sleep_ms (int ms); diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 943b67cce8e..b05a1c00d0f 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -61,7 +61,7 @@ GHash *BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) GHash *gh= MEM_mallocN(sizeof(*gh), info); gh->hashfp= hashfp; gh->cmpfp= cmpfp; - gh->entrypool = BLI_mempool_create(sizeof(Entry), 64, 64, FALSE, FALSE); + gh->entrypool = BLI_mempool_create(sizeof(Entry), 64, 64, 0); gh->cursize= 0; gh->nentries= 0; diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index f01777bdce1..afc8a6a4aa6 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -656,14 +656,14 @@ static int implicit_leafs_index(BVHBuildHelper *data, int depth, int child_index * Its possible to find the position of the child or the parent with simple maths (multiplication and adittion). This type * of tree is for example used on heaps.. where node N has its childs at indexs N*2 and N*2+1. * - * Altought in this case the tree type is general.. and not know until runtime. + * Although in this case the tree type is general.. and not know until runtime. * tree_type stands for the maximum number of childs that a tree node can have. * All tree types >= 2 are supported. * * Advantages of the used trees include: * - No need to store child/parent relations (they are implicit); * - Any node child always has an index greater than the parent; - * - Brother nodes are sequencial in memory; + * - Brother nodes are sequential in memory; * * * Some math relations derived for general implicit trees: @@ -688,7 +688,7 @@ static int implicit_needed_branches(int tree_type, int leafs) * * It arranges the elements in the given partitions such that: * - any element in partition N is less or equal to any element in partition N+1. - * - if all elements are diferent all partition will get the same subset of elements + * - if all elements are different all partition will get the same subset of elements * as if the array was sorted. * * partition P is described as the elements in the range ( nth[P] , nth[P+1] ] @@ -721,7 +721,7 @@ static void split_leafs(BVHNode **leafs_array, int *nth, int partitions, int spl * to use multithread building. * * To archieve this is necessary to find how much leafs are accessible from a certain branch, BVHBuildHelper - * implicit_needed_branches and implicit_leafs_index are auxiliar functions to solve that "optimal-split". + * implicit_needed_branches and implicit_leafs_index are auxiliary functions to solve that "optimal-split". */ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array, BVHNode **leafs_array, int num_leafs) { diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index aac36e5b79b..d5df882ba29 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -71,120 +71,159 @@ struct BLI_mempool { int esize; /* element size in bytes */ int csize; /* chunk size in bytes */ int pchunk; /* number of elements per chunk */ - short use_sysmalloc, allow_iter; + int flag; /* keeps aligned to 16 bits */ - BLI_freenode *free; /* free element list. Interleaved into chunk datas.*/ - int totalloc, totused; /* total number of elements allocated in total, - * and currently in use*/ + BLI_freenode *free; /* free element list. Interleaved into chunk datas. */ + int totalloc, totused; /* total number of elements allocated in total, + * and currently in use */ }; #define MEMPOOL_ELEM_SIZE_MIN (sizeof(void *) * 2) -BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk, - short use_sysmalloc, short allow_iter) +BLI_mempool *BLI_mempool_create(int esize, int totelem, int pchunk, int flag) { BLI_mempool *pool = NULL; BLI_freenode *lasttail = NULL, *curnode = NULL; int i,j, maxchunks; char *addr; - if (esize < MEMPOOL_ELEM_SIZE_MIN) + /* allocate the pool structure */ + if (flag & BLI_MEMPOOL_SYSMALLOC) { + pool = malloc(sizeof(BLI_mempool)); + } + else { + pool = MEM_mallocN(sizeof(BLI_mempool), "memory pool"); + } + + /* set the elem size */ + if (esize < MEMPOOL_ELEM_SIZE_MIN) { esize = MEMPOOL_ELEM_SIZE_MIN; + } + + if (flag & BLI_MEMPOOL_ALLOW_ITER) { + pool->esize = MAX2(esize, sizeof(BLI_freenode)); + } + else { + pool->esize = esize; + } - /*allocate the pool structure*/ - pool = use_sysmalloc ? malloc(sizeof(BLI_mempool)) : MEM_mallocN(sizeof(BLI_mempool), "memory pool"); - pool->esize = allow_iter ? MAX2(esize, sizeof(BLI_freenode)) : esize; - pool->use_sysmalloc = use_sysmalloc; + pool->flag = flag; pool->pchunk = pchunk; pool->csize = esize * pchunk; pool->chunks.first = pool->chunks.last = NULL; - pool->totused= 0; - pool->allow_iter= allow_iter; + pool->totused = 0; - maxchunks = tote / pchunk + 1; - if (maxchunks==0) maxchunks = 1; + maxchunks = totelem / pchunk + 1; + if (maxchunks == 0) { + maxchunks = 1; + } + + /* allocate the actual chunks */ + for (i = 0; i < maxchunks; i++) { + BLI_mempool_chunk *mpchunk; + + if (flag & BLI_MEMPOOL_SYSMALLOC) { + mpchunk = malloc(sizeof(BLI_mempool_chunk)); + mpchunk->data = malloc(pool->csize); + } + else { + mpchunk = MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk"); + mpchunk->data = MEM_mallocN(pool->csize, "BLI Mempool Chunk Data"); + } - /*allocate the actual chunks*/ - for (i=0; i < maxchunks; i++) { - BLI_mempool_chunk *mpchunk = use_sysmalloc ? malloc(sizeof(BLI_mempool_chunk)) : MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk"); mpchunk->next = mpchunk->prev = NULL; - mpchunk->data = use_sysmalloc ? malloc(pool->csize) : MEM_mallocN(pool->csize, "BLI Mempool Chunk Data"); BLI_addtail(&(pool->chunks), mpchunk); - if (i==0) { - pool->free = mpchunk->data; /*start of the list*/ - if (pool->allow_iter) + if (i == 0) { + pool->free = mpchunk->data; /* start of the list */ + if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) { pool->free->freeword = FREEWORD; + } } - /*loop through the allocated data, building the pointer structures*/ - for (addr = mpchunk->data, j=0; j < pool->pchunk; j++) { - curnode = ((BLI_freenode*)addr); + /* loop through the allocated data, building the pointer structures */ + for (addr = mpchunk->data, j = 0; j < pool->pchunk; j++) { + curnode = ((BLI_freenode *)addr); addr += pool->esize; - curnode->next = (BLI_freenode*)addr; - if (pool->allow_iter) { - if (j != pool->pchunk-1) + curnode->next = (BLI_freenode *)addr; + if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) { + if (j != pool->pchunk - 1) curnode->next->freeword = FREEWORD; curnode->freeword = FREEWORD; } } - /*final pointer in the previously allocated chunk is wrong.*/ + /* final pointer in the previously allocated chunk is wrong */ if (lasttail) { lasttail->next = mpchunk->data; - if (pool->allow_iter) + if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) { lasttail->freeword = FREEWORD; + } } - /*set the end of this chunks memoryy to the new tail for next iteration*/ + /* set the end of this chunks memoryy to the new tail for next iteration */ lasttail = curnode; pool->totalloc += pool->pchunk; } - /*terminate the list*/ + /* terminate the list */ curnode->next = NULL; return pool; } void *BLI_mempool_alloc(BLI_mempool *pool) { - void *retval=NULL; + void *retval = NULL; pool->totused++; if (!(pool->free)) { - BLI_freenode *curnode=NULL; + BLI_freenode *curnode = NULL; char *addr; int j; - /*need to allocate a new chunk*/ - BLI_mempool_chunk *mpchunk = pool->use_sysmalloc ? malloc(sizeof(BLI_mempool_chunk)) : MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk"); + /* need to allocate a new chunk */ + BLI_mempool_chunk *mpchunk; + + if (pool->flag & BLI_MEMPOOL_SYSMALLOC) { + mpchunk = malloc(sizeof(BLI_mempool_chunk)); + mpchunk->data = malloc(pool->csize); + } + else { + mpchunk = MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk"); + mpchunk->data = MEM_mallocN(pool->csize, "BLI_Mempool Chunk Data"); + } + mpchunk->next = mpchunk->prev = NULL; - mpchunk->data = pool->use_sysmalloc ? malloc(pool->csize) : MEM_mallocN(pool->csize, "BLI_Mempool Chunk Data"); BLI_addtail(&(pool->chunks), mpchunk); - pool->free = mpchunk->data; /*start of the list*/ - if (pool->allow_iter) + pool->free = mpchunk->data; /* start of the list */ + + if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) { pool->free->freeword = FREEWORD; - for(addr = mpchunk->data, j=0; j < pool->pchunk; j++) { - curnode = ((BLI_freenode*)addr); + } + + for (addr = mpchunk->data, j = 0; j < pool->pchunk; j++) { + curnode = ((BLI_freenode *)addr); addr += pool->esize; - curnode->next = (BLI_freenode*)addr; + curnode->next = (BLI_freenode *)addr; - if (pool->allow_iter) { + if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) { curnode->freeword = FREEWORD; - if (j != pool->pchunk-1) + if (j != pool->pchunk - 1) curnode->next->freeword = FREEWORD; } } - curnode->next = NULL; /*terminate the list*/ + curnode->next = NULL; /* terminate the list */ pool->totalloc += pool->pchunk; } retval = pool->free; - if (pool->allow_iter) + + if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) { pool->free->freeword = 0x7FFFFFFF; + } pool->free = pool->free->next; //memset(retval, 0, pool->esize); @@ -193,7 +232,7 @@ void *BLI_mempool_alloc(BLI_mempool *pool) void *BLI_mempool_calloc(BLI_mempool *pool) { - void *retval= BLI_mempool_alloc(pool); + void *retval = BLI_mempool_alloc(pool); memset(retval, 0, pool->esize); return retval; } @@ -203,41 +242,49 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr) { BLI_freenode *newhead = addr; - if (pool->allow_iter) + if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) { newhead->freeword = FREEWORD; + } + newhead->next = pool->free; pool->free = newhead; pool->totused--; - /*nothing is in use; free all the chunks except the first*/ + /* nothing is in use; free all the chunks except the first */ if (pool->totused == 0) { - BLI_freenode *curnode=NULL; - char *tmpaddr=NULL; + BLI_freenode *curnode = NULL; + char *tmpaddr = NULL; int i; - BLI_mempool_chunk *mpchunk=NULL; - BLI_mempool_chunk *first= pool->chunks.first; + BLI_mempool_chunk *mpchunk = NULL; + BLI_mempool_chunk *first = pool->chunks.first; BLI_remlink(&pool->chunks, first); - for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) { - if (pool->use_sysmalloc) free(mpchunk->data); - else MEM_freeN(mpchunk->data); + if (pool->flag & BLI_MEMPOOL_SYSMALLOC) { + for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) { + free(mpchunk->data); + } + BLI_freelist(&(pool->chunks)); + } + else { + for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) { + MEM_freeN(mpchunk->data); + } + BLI_freelistN(&(pool->chunks)); } - pool->use_sysmalloc ? BLI_freelist(&(pool->chunks)) : BLI_freelistN(&(pool->chunks)); - BLI_addtail(&pool->chunks, first); pool->totalloc = pool->pchunk; - pool->free = first->data; /*start of the list*/ - for (tmpaddr = first->data, i=0; i < pool->pchunk; i++) { - curnode = ((BLI_freenode*)tmpaddr); + pool->free = first->data; /* start of the list */ + for (tmpaddr = first->data, i = 0; i < pool->pchunk; i++) { + curnode = ((BLI_freenode *)tmpaddr); tmpaddr += pool->esize; - curnode->next = (BLI_freenode*)tmpaddr; + curnode->next = (BLI_freenode *)tmpaddr; } - curnode->next = NULL; /*terminate the list*/ + curnode->next = NULL; /* terminate the list */ } } @@ -248,7 +295,7 @@ int BLI_mempool_count(BLI_mempool *pool) void *BLI_mempool_findelem(BLI_mempool *pool, int index) { - if (!pool->allow_iter) { + if (!(pool->flag & BLI_MEMPOOL_ALLOW_ITER)) { fprintf(stderr, "%s: Error! you can't iterate over this mempool!\n", __func__); return NULL; } @@ -257,7 +304,7 @@ void *BLI_mempool_findelem(BLI_mempool *pool, int index) BLI_mempool_iter iter; void *elem; BLI_mempool_iternew(pool, &iter); - for (elem= BLI_mempool_iterstep(&iter); index-- != 0; elem= BLI_mempool_iterstep(&iter)) { }; + for (elem = BLI_mempool_iterstep(&iter); index-- != 0; elem = BLI_mempool_iterstep(&iter)) { }; return elem; } @@ -266,7 +313,7 @@ void *BLI_mempool_findelem(BLI_mempool *pool, int index) void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter) { - if (!pool->allow_iter) { + if (!(pool->flag & BLI_MEMPOOL_ALLOW_ITER)) { fprintf(stderr, "%s: Error! you can't iterate over this mempool!\n", __func__); iter->curchunk = NULL; iter->curindex = 0; @@ -288,7 +335,7 @@ static void *bli_mempool_iternext(BLI_mempool_iter *iter) if (!iter->curchunk || !iter->pool->totused) return NULL; - ret = ((char*)iter->curchunk->data) + iter->pool->esize*iter->curindex; + ret = ((char *)iter->curchunk->data) + iter->pool->esize * iter->curindex; iter->curindex++; @@ -325,7 +372,7 @@ void *BLI_mempool_iterstep(BLI_mempool_iter *iter) do { if (LIKELY(iter->curchunk)) { - ret = (BLI_freenode *)(((char*)iter->curchunk->data) + iter->pool->esize*iter->curindex); + ret = (BLI_freenode *)(((char *)iter->curchunk->data) + iter->pool->esize * iter->curindex); } else { return NULL; @@ -344,9 +391,9 @@ void *BLI_mempool_iterstep(BLI_mempool_iter *iter) void BLI_mempool_destroy(BLI_mempool *pool) { - BLI_mempool_chunk *mpchunk=NULL; + BLI_mempool_chunk *mpchunk = NULL; - if (pool->use_sysmalloc) { + if (pool->flag & BLI_MEMPOOL_SYSMALLOC) { for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) { free(mpchunk->data); } diff --git a/source/blender/blenlib/intern/DLRB_tree.c b/source/blender/blenlib/intern/DLRB_tree.c index b7df06bbf24..0e90042a35f 100644 --- a/source/blender/blenlib/intern/DLRB_tree.c +++ b/source/blender/blenlib/intern/DLRB_tree.c @@ -36,7 +36,7 @@ /* *********************************************** */ /* Tree API */ -/* Create a new tree, and initialise as necessary */ +/* Create a new tree, and initialize as necessary */ DLRBT_Tree *BLI_dlrbTree_new (void) { /* just allocate for now */ diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c index cf18fbd57cd..57174d0c0dd 100644 --- a/source/blender/blenlib/intern/boxpack2d.c +++ b/source/blender/blenlib/intern/boxpack2d.c @@ -295,7 +295,7 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he isect = 1; } else { /* do a full search for colliding box - * this is really slow, some spacialy divided + * this is really slow, some spatially divided * data-structure would be better */ for (box_test=boxarray; box_test != box; box_test++) { if BOXINTERSECT(box, box_test) { diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index df23f792aa3..531a4de361e 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -83,7 +83,7 @@ EdgeHash *BLI_edgehash_new(void) eh->nbuckets = _ehash_hashsizes[eh->cursize]; eh->buckets = MEM_callocN(eh->nbuckets * sizeof(*eh->buckets), "eh buckets 2"); - eh->epool = BLI_mempool_create(sizeof(EdgeEntry), 512, 512, TRUE, FALSE); + eh->epool = BLI_mempool_create(sizeof(EdgeEntry), 512, 512, BLI_MEMPOOL_SYSMALLOC); return eh; } diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index ad0478060f2..895ae03ab0f 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -323,7 +323,7 @@ int BLI_rename(const char *from, const char *to) /* * but the UNIX world is tied to the interface, and the system * timer, and... We implement a callback mechanism. The system will - * have to initialise the callback before the functions will work! + * have to initialize the callback before the functions will work! * */ static char str[12 + (MAXPATHLEN * 2)]; diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index f903072afb9..64b31df9c8e 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -850,7 +850,7 @@ int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], cons float l1_plane[3]; /* line point aligned with the plane */ float dist; /* 'plane_no' aligned distance to the 'plane_co' */ - /* for pradictable flipping since the plane is only used to + /* for predictable flipping since the plane is only used to * define a direction, ignore its flipping and aligned with 'l_vec' */ if(dot < 0.0f) { dot= -dot; diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index f1dc65bd066..e07025ccf56 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -1196,7 +1196,7 @@ void loc_eul_size_to_mat4(float mat[4][4], const float loc[3], const float eul[3 { float rmat[3][3], smat[3][3], tmat[3][3]; - /* initialise new matrix */ + /* initialize new matrix */ unit_m4(mat); /* make rotation + scaling part */ @@ -1219,7 +1219,7 @@ void loc_eulO_size_to_mat4(float mat[4][4], const float loc[3], const float eul[ { float rmat[3][3], smat[3][3], tmat[3][3]; - /* initialise new matrix */ + /* initialize new matrix */ unit_m4(mat); /* make rotation + scaling part */ @@ -1243,7 +1243,7 @@ void loc_quat_size_to_mat4(float mat[4][4], const float loc[3], const float quat { float rmat[3][3], smat[3][3], tmat[3][3]; - /* initialise new matrix */ + /* initialize new matrix */ unit_m4(mat); /* make rotation + scaling part */ diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 18f7767c303..ec8e1cf6b82 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -378,8 +378,8 @@ void BLI_cleanup_path(const char *relabase, char *dir) } /* support for odd paths: eg /../home/me --> /home/me - * this is a valid path in blender but we cant handle this the useual way below - * simply strip this prefix then evaluate the path as useual. pythons os.path.normpath() does this */ + * this is a valid path in blender but we cant handle this the usual way below + * simply strip this prefix then evaluate the path as usual. pythons os.path.normpath() does this */ while((strncmp(dir, "/../", 4)==0)) { memmove( dir, dir + 4, strlen(dir + 4) + 1 ); } @@ -694,7 +694,7 @@ int BLI_path_abs(char *path, const char *basepath) BLI_char_switch(base, '\\', '/'); /* Paths starting with // will get the blend file as their base, - * this isnt standard in any os but is uesed in blender all over the place */ + * this isnt standard in any os but is used in blender all over the place */ if (wasrelative) { char *lslash= BLI_last_slash(base); if (lslash) { @@ -1571,7 +1571,7 @@ char *BLI_path_basename(char *path) This logic will help ensure that all image paths are relative and that a user gets his images in one place. It'll also provide - consistent behaviour across exporters. + consistent behavior across exporters. */ int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const char *base_dir, const char *src_dir, const char *dest_dir) { @@ -1748,9 +1748,9 @@ static int add_win32_extension(char *name) * the name to its 8.3 version to prevent problems with * spaces and stuff. Final result is returned in fullname. * -* @param fullname The full path and full name of the executable +* \param fullname The full path and full name of the executable * (must be FILE_MAX minimum) -* @param name The name of the executable (usually argv[0]) to be checked +* \param name The name of the executable (usually argv[0]) to be checked */ static void bli_where_am_i(char *fullname, const size_t maxlen, const char *name) { @@ -1854,9 +1854,9 @@ const char *BLI_program_dir(void) * * Also make sure the temp dir has a trailing slash * -* @param fullname The full path to the temp directory -* @param maxlen The size of the fullname buffer -* @param userdir Directory specified in user preferences +* \param fullname The full path to the temp directory +* \param maxlen The size of the fullname buffer +* \param userdir Directory specified in user preferences */ static void BLI_where_is_temp(char *fullname, const size_t maxlen, char *userdir) { diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index 3a66425a5de..e2c86d70872 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -184,8 +184,8 @@ char *BLI_getQuotedStr (const char *str, const char *prefix) return BLI_strdupn(startMatch, (size_t)(endMatch-startMatch)); } -/* Replaces all occurances of oldText with newText in str, returning a new string that doesn't - * contain the 'replaced' occurances. +/* Replaces all occurrences of oldText with newText in str, returning a new string that doesn't + * contain the 'replaced' occurrences. */ // A rather wasteful string-replacement utility, though this shall do for now... // Feel free to replace this with an even safe + nicer alternative @@ -231,7 +231,7 @@ char *BLI_replacestr(char *str, const char *oldText, const char *newText) str += lenOld; } - /* finish off and return a new string that has had all occurances of */ + /* finish off and return a new string that has had all occurrences of */ if (ds) { char *newStr; diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index cf865b5686d..c958648836b 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -369,7 +369,7 @@ unsigned int BLI_str_utf8_as_unicode(const char *p) return result; } -/* varient that increments the length */ +/* variant that increments the length */ unsigned int BLI_str_utf8_as_unicode_and_size(const char *p, size_t *index) { int i, mask = 0, len; @@ -384,7 +384,7 @@ unsigned int BLI_str_utf8_as_unicode_and_size(const char *p, size_t *index) return result; } -/* another varient that steps over the index, +/* another variant that steps over the index, * note, currently this also falls back to latin1 for text drawing. */ unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index) { @@ -433,7 +433,7 @@ unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index) /** * BLI_str_utf8_from_unicode: * @c a Unicode character code - * @param outbuf output buffer, must have at least 6 bytes of space. + * \param outbuf output buffer, must have at least 6 bytes of space. * If %NULL, the length will be computed and returned * and nothing will be written to outbuf. * diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c index f6c8c634c8d..dd56988fd90 100644 --- a/source/blender/blenlib/intern/voxel.c +++ b/source/blender/blenlib/intern/voxel.c @@ -43,7 +43,7 @@ BM_INLINE float D(float *data, const int res[3], int x, int y, int z) return data[ V_I(x, y, z, res) ]; } -/* *** nearest neighbour *** */ +/* *** nearest neighbor *** */ /* input coordinates must be in bounding box 0.0 - 1.0 */ float voxel_sample_nearest(float *data, const int res[3], const float co[3]) { diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index 52d06c36bdf..ffac9a2a88f 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -78,10 +78,10 @@ typedef struct BlendFileData { * returns NULL and sets a report in the list if * it cannot open the file. * - * @param filepath The path of the file to open. - * @param reports If the return value is NULL, errors + * \param filepath The path of the file to open. + * \param reports If the return value is NULL, errors * indicating the cause of the failure. - * @return The data of the file. + * \return The data of the file. */ BlendFileData* BLO_read_from_file(const char *filepath, struct ReportList *reports); @@ -90,11 +90,11 @@ BlendFileData* BLO_read_from_file(const char *filepath, struct ReportList *repor * returns NULL and sets a report in the list if * it cannot open the file. * - * @param mem The file data. - * @param memsize The length of @a mem. - * @param reports If the return value is NULL, errors + * \param mem The file data. + * \param memsize The length of \a mem. + * \param reports If the return value is NULL, errors * indicating the cause of the failure. - * @return The data of the file. + * \return The data of the file. */ BlendFileData* BLO_read_from_memory(void *mem, int memsize, struct ReportList *reports); @@ -109,7 +109,7 @@ BlendFileData *BLO_read_from_memfile(struct Main *oldmain, const char *filename, * data associated with it (the userdef data, and * the main libblock data). * - * @param bfd The structure to free. + * \param bfd The structure to free. */ void BLO_blendfiledata_free( @@ -118,9 +118,9 @@ BLO_blendfiledata_free( /** * Open a blendhandle from a file path. * - * @param file The file path to open. - * @param reports Report errors in opening the file (can be NULL). - * @return A handle on success, or NULL on failure. + * \param file The file path to open. + * \param reports Report errors in opening the file (can be NULL). + * \return A handle on success, or NULL on failure. */ BlendHandle* BLO_blendhandle_from_file( @@ -130,9 +130,9 @@ BLO_blendhandle_from_file( /** * Open a blendhandle from memory. * - * @param mem The data to load from. - * @param memsize The size of the data. - * @return A handle on success, or NULL on failure. + * \param mem The data to load from. + * \param memsize The size of the data. + * \return A handle on success, or NULL on failure. */ BlendHandle* @@ -145,10 +145,10 @@ BLO_blendhandle_from_memory( * of a certain type (ie. All the scene names in * a file). * - * @param bh The blendhandle to access. - * @param ofblocktype The type of names to get. - * @param tot_names The length of the returned list. - * @return A BLI_linklist of strings. The string links + * \param bh The blendhandle to access. + * \param ofblocktype The type of names to get. + * \param tot_names The length of the returned list. + * \return A BLI_linklist of strings. The string links * should be freed with malloc. */ struct LinkNode* @@ -162,10 +162,10 @@ BLO_blendhandle_get_datablock_names( * of a certain type (ie. All the scene names in * a file). * - * @param bh The blendhandle to access. - * @param ofblocktype The type of names to get. - * @param tot_prev The length of the returned list. - * @return A BLI_linklist of PreviewImage. The PreviewImage links + * \param bh The blendhandle to access. + * \param ofblocktype The type of names to get. + * \param tot_prev The length of the returned list. + * \return A BLI_linklist of PreviewImage. The PreviewImage links * should be freed with malloc. */ struct LinkNode* @@ -179,8 +179,8 @@ BLO_blendhandle_get_previews( * file. (ie. file contains Scene, Mesh, and Lamp * datablocks). * - * @param bh The blendhandle to access. - * @return A BLI_linklist of strings. The string links + * \param bh The blendhandle to access. + * \return A BLI_linklist of strings. The string links * should be freed with malloc. */ struct LinkNode* @@ -191,7 +191,7 @@ BLO_blendhandle_get_linkable_groups( * Close and free a blendhandle. The handle * becomes invalid after this call. * - * @param bh The handle to close. + * \param bh The handle to close. */ void BLO_blendhandle_close( @@ -212,10 +212,10 @@ int BLO_is_a_library(const char *path, char *dir, char *group); /** * Initialize the BlendHandle for appending or linking library data. * - * @param mainvar The current main database eg G.main or CTX_data_main(C). - * @param bh A blender file handle as returned by BLO_blendhandle_from_file or BLO_blendhandle_from_memory. - * @param filepath Used for relative linking, copied to the lib->name - * @return the library Main, to be passed to BLO_library_append_named_part as mainl. + * \param mainvar The current main database eg G.main or CTX_data_main(C). + * \param bh A blender file handle as returned by BLO_blendhandle_from_file or BLO_blendhandle_from_memory. + * \param filepath Used for relative linking, copied to the lib->name + * \return the library Main, to be passed to BLO_library_append_named_part as mainl. */ struct Main* BLO_library_append_begin(struct Main *mainvar, BlendHandle** bh, const char *filepath); @@ -223,11 +223,11 @@ struct Main* BLO_library_append_begin(struct Main *mainvar, BlendHandle** bh, co /** * Link/Append a named datablock from an external blend file. * - * @param mainl The main database to link from (not the active one). - * @param bh The blender file handle. - * @param idname The name of the datablock (without the 2 char ID prefix) - * @param idcode The kind of datablock to link. - * @return the appended ID when found. + * \param mainl The main database to link from (not the active one). + * \param bh The blender file handle. + * \param idname The name of the datablock (without the 2 char ID prefix) + * \param idcode The kind of datablock to link. + * \return the appended ID when found. */ struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle** bh, const char *idname, const int idcode); @@ -235,13 +235,13 @@ struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle** bh, c * Link/Append a named datablock from an external blend file. * optionally instance the object in the scene when the flags are set. * - * @param C The context, when NULL instancing object in the scene isnt done. - * @param mainl The main database to link from (not the active one). - * @param bh The blender file handle. - * @param idname The name of the datablock (without the 2 char ID prefix) - * @param idcode The kind of datablock to link. - * @param flag Options for linking, used for instancing. - * @return the appended ID when found. + * \param C The context, when NULL instancing object in the scene isnt done. + * \param mainl The main database to link from (not the active one). + * \param bh The blender file handle. + * \param idname The name of the datablock (without the 2 char ID prefix) + * \param idcode The kind of datablock to link. + * \param flag Options for linking, used for instancing. + * \return the appended ID when found. */ struct ID *BLO_library_append_named_part_ex(const struct bContext *C, struct Main *mainl, BlendHandle** bh, const char *idname, const int idcode, const short flag); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e3dca8db299..09a7d92baa8 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7046,7 +7046,7 @@ static void area_add_header_region(ScrArea *sa, ListBase *lb) else ar->alignment= RGN_ALIGN_TOP; - /* initialise view2d data for header region, to allow panning */ + /* initialize view2d data for header region, to allow panning */ /* is copy from ui_view2d.c */ ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT); ar->v2d.keepofs = V2D_LOCKOFS_Y; @@ -7874,6 +7874,77 @@ static void do_versions_nodetree_socket_auto_hidden_flags_2_62(bNodeTree *ntree) } } +static void do_versions_nodetree_multi_file_output_format_2_62_1(Scene *sce, bNodeTree *ntree) +{ + bNode *node; + bNodeSocket *sock; + + for (node=ntree->nodes.first; node; node=node->next) { + if (node->type==CMP_NODE_OUTPUT_FILE) { + /* previous CMP_NODE_OUTPUT_FILE nodes get converted to multi-file outputs */ + NodeImageFile *old_data = node->storage; + NodeImageMultiFile *nimf= MEM_callocN(sizeof(NodeImageMultiFile), "node image multi file"); + bNodeSocket *old_image = BLI_findlink(&node->inputs, 0); + bNodeSocket *old_z = BLI_findlink(&node->inputs, 1); + bNodeSocket *sock; + + node->storage= nimf; + + BLI_strncpy(nimf->base_path, old_data->name, sizeof(nimf->base_path)); + nimf->format = old_data->im_format; + + /* if z buffer is saved, change the image type to multilayer exr. + * XXX this is slightly messy, Z buffer was ignored before for anything but EXR and IRIS ... + * i'm just assuming here that IRIZ means IRIS with z buffer ... + */ + if (ELEM(old_data->im_format.imtype, R_IMF_IMTYPE_IRIZ, R_IMF_IMTYPE_OPENEXR)) { + nimf->format.imtype = R_IMF_IMTYPE_MULTILAYER; + sock = ntreeCompositOutputFileAddSocket(ntree, node, old_image->name, &nimf->format); + if (old_image->link) { + old_image->link->tosock = sock; + sock->link = old_image->link; + } + sock = ntreeCompositOutputFileAddSocket(ntree, node, old_z->name, &nimf->format); + if (old_z->link) { + old_z->link->tosock = sock; + sock->link = old_z->link; + } + } + else { + /* saves directly to base path, which is the old image output path */ + sock = ntreeCompositOutputFileAddSocket(ntree, node, "", &nimf->format); + if (old_image->link) { + old_image->link->tosock = sock; + sock->link = old_image->link; + } + } + + nodeRemoveSocket(ntree, node, old_image); + nodeRemoveSocket(ntree, node, old_z); + MEM_freeN(old_data); + } + else if (node->type==CMP_NODE_OUTPUT_MULTI_FILE__DEPRECATED) { + NodeImageMultiFile *nimf = node->storage; + + /* CMP_NODE_OUTPUT_MULTI_FILE has been redeclared as CMP_NODE_OUTPUT_FILE */ + node->type = CMP_NODE_OUTPUT_FILE; + + /* initialize the node-wide image format from render data, if available */ + if (sce) + nimf->format = sce->r.im_format; + + /* transfer render format toggle to node format toggle */ + for (sock=node->inputs.first; sock; sock=sock->next) { + NodeImageMultiFileSocket *simf = sock->storage; + simf->use_node_format = simf->use_render_format; + } + + /* we do have preview now */ + node->flag |= NODE_PREVIEW; + } + } +} + static void do_versions(FileData *fd, Library *lib, Main *main) { /* WATCH IT!!!: pointers from libdata have not been converted */ @@ -8490,7 +8561,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ob = main->object.first; /* adapt form factor in order to get the 'old' physics - * behaviour back...*/ + * behavior back...*/ while (ob) { /* in future, distinguish between different @@ -9986,7 +10057,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - /* correctly initialise constinv matrix */ + /* correctly initialize constinv matrix */ unit_m4(ob->constinv); if (ob->type == OB_ARMATURE) { @@ -10016,7 +10087,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - /* correctly initialise constinv matrix */ + /* correctly initialize constinv matrix */ unit_m4(pchan->constinv); } } @@ -10842,7 +10913,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ob->m_contactProcessingThreshold = 1.; //pad3 is used for m_contactProcessingThreshold if(ob->parent) { /* check if top parent has compound shape set and if yes, set this object - to compound shaper as well (was the behaviour before, now it's optional) */ + to compound shaper as well (was the behavior before, now it's optional) */ Object *parent= newlibadr(fd, lib, ob->parent); while (parent && parent != ob && parent->parent != NULL) { parent = newlibadr(fd, lib, parent->parent); @@ -10983,7 +11054,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) do_versions_gpencil_2_50(main, screen); } - /* shader, composit and texture node trees have id.name empty, put something in + /* shader, composite and texture node trees have id.name empty, put something in * to have them show in RNA viewer and accessible otherwise. */ for(ma= main->mat.first; ma; ma= ma->id.next) { @@ -10999,7 +11070,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } } - /* and composit trees */ + /* and composite trees */ for(sce= main->scene.first; sce; sce= sce->id.next) { if(sce->nodetree && sce->nodetree->id.name[0] == '\0') strcpy(sce->nodetree->id.name, "NTCompositing Nodetree"); @@ -11392,7 +11463,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Object *ob; Lamp *la; - /* New variables for axis-angle rotations and/or quaternion rotations were added, and need proper initialisation */ + /* New variables for axis-angle rotations and/or quaternion rotations were added, and need proper initialization */ for (ob= main->object.first; ob; ob= ob->id.next) { /* new variables for all objects */ ob->quat[0]= 1.0f; @@ -11628,7 +11699,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) { Object *ob; - /* properly initialise hair clothsim data on old files */ + /* properly initialize hair clothsim data on old files */ for(ob = main->object.first; ob; ob = ob->id.next) { ModifierData *md; for(md= ob->modifiers.first; md; md= md->next) { @@ -11737,11 +11808,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* anim viz changes */ for (ob= main->object.first; ob; ob= ob->id.next) { - /* initialise object defaults */ + /* initialize object defaults */ animviz_settings_init(&ob->avs); /* if armature, copy settings for pose from armature data - * performing initialisation where appropriate + * performing initialization where appropriate */ if (ob->pose && ob->data) { bArmature *arm= newlibadr(fd, lib, ob->data); @@ -12013,7 +12084,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (brush->curve) brush->curve->preset = CURVE_PRESET_SMOOTH; } - /* properly initialise active flag for fluidsim modifiers */ + /* properly initialize active flag for fluidsim modifiers */ for(ob = main->object.first; ob; ob = ob->id.next) { ModifierData *md; for(md= ob->modifiers.first; md; md= md->next) { @@ -12170,7 +12241,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - /* initialise scene active layer */ + /* initialize scene active layer */ for (scene= main->scene.first; scene; scene=scene->id.next) { int i; for(i=0; i<20; i++) { @@ -12500,7 +12571,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) bNodeTree *ntree; /* node sockets are not exposed automatically any more, - * this mimics the old behaviour by adding all unlinked sockets to groups. + * this mimics the old behavior by adding all unlinked sockets to groups. */ for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next) { /* XXX Only setting a flag here. Actual adding of group sockets @@ -12540,7 +12611,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* redraws flag in SpaceTime has been moved to Screen level */ for (sc = main->screen.first; sc; sc= sc->id.next) { if (sc->redraws_flag == 0) { - /* just initialise to default? */ + /* just initialize to default? */ // XXX: we could also have iterated through areas, and taken them from the first timeline available... sc->redraws_flag = TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN; } @@ -13353,6 +13424,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 262 || (main->versionfile == 262 && main->subversionfile < 1)) + { + /* update use flags for node sockets (was only temporary before) */ + Scene *sce; + bNodeTree *ntree; + + for (sce=main->scene.first; sce; sce=sce->id.next) + if (sce->nodetree) + do_versions_nodetree_multi_file_output_format_2_62_1(sce, sce->nodetree); + + /* XXX can't associate with scene for group nodes, image format will stay uninitialized */ + for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next) + do_versions_nodetree_multi_file_output_format_2_62_1(NULL, ntree); + } + /* default values in Freestyle settings */ { diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 36e41e75565..47d0ee2246b 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -232,9 +232,9 @@ static void writedata_free(WriteData *wd) /** * Low level WRITE(2) wrapper that buffers data - * @param adr Pointer to new chunk of data - * @param len Length of new chunk of data - * @warning Talks to other functions with global parameters + * \param adr Pointer to new chunk of data + * \param len Length of new chunk of data + * \warning Talks to other functions with global parameters */ #define MYWRITE_FLUSH NULL @@ -285,10 +285,10 @@ static void mywrite( WriteData *wd, void *adr, int len) /** * BeGiN initializer for mywrite - * @param file File descriptor - * @param compare Previous memory file (can be NULL). - * @param current The current memory file (can be NULL). - * @warning Talks to other functions with global parameters + * \param file File descriptor + * \param compare Previous memory file (can be NULL). + * \param current The current memory file (can be NULL). + * \warning Talks to other functions with global parameters */ static WriteData *bgnwrite(int file, MemFile *compare, MemFile *current) { @@ -306,9 +306,9 @@ static WriteData *bgnwrite(int file, MemFile *compare, MemFile *current) /** * END the mywrite wrapper - * @return 1 if write failed - * @return unknown global variable otherwise - * @warning Talks to other functions with global parameters + * \return 1 if write failed + * \return unknown global variable otherwise + * \warning Talks to other functions with global parameters */ static int endwrite(WriteData *wd) { @@ -728,7 +728,7 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree) writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage); } - if (node->type==CMP_NODE_OUTPUT_MULTI_FILE) { + if (node->type==CMP_NODE_OUTPUT_FILE) { /* inputs have own storage data */ for (sock=node->inputs.first; sock; sock=sock->next) writestruct(wd, DATA, "NodeImageMultiFileSocket", 1, sock->storage); diff --git a/source/blender/blenpluginapi/documentation.h b/source/blender/blenpluginapi/documentation.h index 45e9ec7f2e4..3e4aa3cd2ed 100644 --- a/source/blender/blenpluginapi/documentation.h +++ b/source/blender/blenpluginapi/documentation.h @@ -27,13 +27,13 @@ * @mainpage plugin API - the access point for texture and sequence * plugins * - * @section about About the plugin API + * \section about About the plugin API * * This API wraps functions that are used by texture and sequence * plugins. They are explicitly wrapped in order to make the * dependencies to the rest of the system clear. * - * @section issues Known issues with the plugin API + * \section issues Known issues with the plugin API * * - It can be difficult at times to get access to the API functions * linked into the final executable. On gcc, the -fpic and -shared @@ -59,7 +59,7 @@ * code. It will be removed as soon as the replacing system is in * place. * - * @section dependencies Dependencies + * \section dependencies Dependencies * * The plugins wraps functions from IMB and BLI. In addition, they * define some useful variables. diff --git a/source/blender/bmesh/bmesh.h b/source/blender/bmesh/bmesh.h index e5c3ee2ef72..9cf71e66b1c 100644 --- a/source/blender/bmesh/bmesh.h +++ b/source/blender/bmesh/bmesh.h @@ -201,64 +201,13 @@ extern "C" { #include "DNA_listBase.h" #include "DNA_customdata_types.h" +#include <stdlib.h> #include "BLI_utildefines.h" #include "bmesh_class.h" /*forward declarations*/ -/* - * BMHeader - * - * All mesh elements begin with a BMHeader. This structure - * hold several types of data - * - * 1: The type of the element (vert, edge, loop or face) - * 2: Persistant "header" flags/markings (sharp, seam, select, hidden, ect) - note that this is different from the "tool" flags. - * 3: Unique ID in the bmesh. - * 4: some elements for internal record keeping. - * -*/ - -/* BMHeader->htype (char) */ -enum { - BM_VERT = 1, - BM_EDGE = 2, - BM_LOOP = 4, - BM_FACE = 8 -}; - -#define BM_ALL (BM_VERT | BM_EDGE | BM_LOOP | BM_FACE) - -/* BMHeader->hflag (char) */ -enum { - BM_ELEM_SELECT = (1 << 0), - BM_ELEM_HIDDEN = (1 << 1), - BM_ELEM_SEAM = (1 << 2), - BM_ELEM_SMOOTH = (1 << 3), /* used for faces and edges, note from the user POV, - * this is a sharp edge when disabled */ - - BM_ELEM_TAG = (1 << 4), /* internal flag, used for ensuring correct normals - * during multires interpolation, and any other time - * when temp tagging is handy. - * always assume dirty & clear before use. */ - - BM_ELEM_FREESTYLE = (1 << 5), /* used for Freestyle faces and edges */ - /* we have 2 spare flags which is awesome but since we're limited to 8 - * only add new flags with care! - campbell */ - /* BM_ELEM_SPARE = (1 << 5), */ - /* BM_ELEM_SPARE = (1 << 6), */ - - BM_ELEM_INTERNAL_TAG = (1 << 7) /* for low level internal API tagging, - * since tools may want to tag verts and - * not have functions clobber them */ -}; - -/* Mesh Level Ops */ -extern int bm_mesh_allocsize_default[4]; - - /* ------------------------------------------------------------------------- */ /* bmesh_inline.c */ @@ -282,7 +231,7 @@ BM_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b); * sure if the index values are valid because certain operations have modified * the mesh structure. * - * To set the elements to valid indicies 'BM_mesh_elem_index_ensure' should be used + * To set the elements to valid indices 'BM_mesh_elem_index_ensure' should be used * rather then adding inline loops, however there are cases where we still * set the index directly * diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index f071e00211c..59ad60f32e5 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -47,6 +47,19 @@ struct Object; * * hrm. it doesnt but stull works ok, remove the comment above? - campbell. */ + +/** + * BMHeader + * + * All mesh elements begin with a BMHeader. This structure + * hold several types of data + * + * 1: The type of the element (vert, edge, loop or face) + * 2: Persistant "header" flags/markings (smooth, seam, select, hidden, ect) + * note that this is different from the "tool" flags. + * 3: Unique ID in the bmesh. + * 4: some elements for internal record keeping. + */ typedef struct BMHeader { void *data; /* customdata layers */ int index; /* notes: @@ -54,7 +67,7 @@ typedef struct BMHeader { * - Unitialized to -1 so we can easily tell its not set. * - Used for edge/vert/face, check BMesh.elem_index_dirty for valid index values, * this is abused by various tools which set it dirty. - * - For loops this is used for sorting during tesselation. */ + * - For loops this is used for sorting during tessellation. */ char htype; /* element geometric type (verts/edges/loops/faces) */ char hflag; /* this would be a CD layer, see below */ @@ -188,4 +201,39 @@ typedef struct BMesh { int opflag; /* current operator flag */ } BMesh; +/* BMHeader->htype (char) */ +enum { + BM_VERT = 1, + BM_EDGE = 2, + BM_LOOP = 4, + BM_FACE = 8 +}; + +#define BM_ALL (BM_VERT | BM_EDGE | BM_LOOP | BM_FACE) + +/* BMHeader->hflag (char) */ +enum { + BM_ELEM_SELECT = (1 << 0), + BM_ELEM_HIDDEN = (1 << 1), + BM_ELEM_SEAM = (1 << 2), + BM_ELEM_SMOOTH = (1 << 3), /* used for faces and edges, note from the user POV, + * this is a sharp edge when disabled */ + + BM_ELEM_TAG = (1 << 4), /* internal flag, used for ensuring correct normals + * during multires interpolation, and any other time + * when temp tagging is handy. + * always assume dirty & clear before use. */ + + BM_ELEM_FREESTYLE = (1 << 5), /* used for Freestyle faces and edges */ + + /* we have 2 spare flags which is awesome but since we're limited to 8 + * only add new flags with care! - campbell */ + /* BM_ELEM_SPARE = (1 << 5), */ + /* BM_ELEM_SPARE = (1 << 6), */ + + BM_ELEM_INTERNAL_TAG = (1 << 7) /* for low level internal API tagging, + * since tools may want to tag verts and + * not have functions clobber them */ +}; + #endif /* __BMESH_CLASS_H__ */ diff --git a/source/blender/bmesh/bmesh_error.h b/source/blender/bmesh/bmesh_error.h index 7afddf65a97..b88b1ff890f 100644 --- a/source/blender/bmesh/bmesh_error.h +++ b/source/blender/bmesh/bmesh_error.h @@ -65,7 +65,7 @@ void BMO_error_clear(BMesh *bm); #define BMERR_WALKER_FAILED 4 #define BMERR_DISSOLVEFACES_FAILED 5 #define BMERR_DISSOLVEVERTS_FAILED 6 -#define BMERR_TESSELATION 7 +#define BMERR_TESSELLATION 7 #define BMERR_NONMANIFOLD 8 #define BMERR_INVALID_SELECTION 9 #define BMERR_MESH_ERROR 10 diff --git a/source/blender/bmesh/bmesh_operator_api.h b/source/blender/bmesh/bmesh_operator_api.h index b5535b5bf58..04cca767d9e 100644 --- a/source/blender/bmesh/bmesh_operator_api.h +++ b/source/blender/bmesh/bmesh_operator_api.h @@ -31,13 +31,9 @@ extern "C" { #endif -#include "BLI_memarena.h" #include "BLI_ghash.h" -#include "BKE_utildefines.h" - #include <stdarg.h> -#include <string.h> /* for memcpy */ /* * operators represent logical, executable mesh modules. all topological @@ -140,7 +136,7 @@ typedef struct BMOperator { int needflag; int flag; struct BMOpSlot slots[BMO_OP_MAX_SLOTS]; void (*exec)(BMesh *bm, struct BMOperator *op); - MemArena *arena; + struct MemArena *arena; } BMOperator; #define MAX_SLOTNAME 32 @@ -291,8 +287,8 @@ void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *op, const char htype, cons /* puts every element of type type (which is a bitmask) with tool flag flag, * into a slot. */ -void BMO_slot_from_flag(BMesh *bm, BMOperator *op, const char *slotname, - const short oflag, const char htype); +void BMO_slot_buffer_from_flag(BMesh *bm, BMOperator *op, const char *slotname, + const short oflag, const char htype); /* tool-flags all elements inside an element slot array with flag flag. */ void BMO_slot_buffer_flag_enable(BMesh *bm, BMOperator *op, const char *slotname, @@ -311,11 +307,11 @@ void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotna /* puts every element of type type (which is a bitmask) with header flag * flag, into a slot. note: ignores hidden elements (e.g. elements with * header flag BM_ELEM_HIDDEN set).*/ -void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, - const char hflag, const char htype); +void BMO_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, + const char hflag, const char htype); /* counts number of elements inside a slot array. */ -int BMO_slot_buf_count(BMesh *bm, BMOperator *op, const char *slotname); +int BMO_slot_buffer_count(BMesh *bm, BMOperator *op, const char *slotname); int BMO_slot_map_count(BMesh *bm, BMOperator *op, const char *slotname); void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slotname, @@ -327,8 +323,8 @@ int BMO_vert_edge_flags_count(BMesh *bm, BMVert *v, const short oflag); /* flags all elements in a mapping. note that the mapping must only have * bmesh elements in it.*/ -void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op, - const char *slotname, const short oflag); +void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op, const char *slotname, + const short oflag, const char hflag); /* this part of the API is used to iterate over element buffer or * mapping slots. @@ -371,7 +367,7 @@ typedef struct BMOIter { char restrictmask; /* bitwise '&' with BMHeader.htype */ } BMOIter; -void *BMO_slot_elem_first(BMOperator *op, const char *slotname); +void *BMO_slot_buffer_elem_first(BMOperator *op, const char *slotname); /* restrictmask restricts the iteration to certain element types * (e.g. combination of BM_VERT, BM_EDGE, BM_FACE), if iterating diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index e7104249e94..ccb8fd9b1af 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -575,9 +575,9 @@ void BM_elem_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, const void *sour } } -BMesh *BM_mesh_copy(BMesh *bmold) +BMesh *BM_mesh_copy(BMesh *bm_old) { - BMesh *bm; + BMesh *bm_new; BMVert *v, *v2, **vtable = NULL; BMEdge *e, *e2, **edges = NULL, **etable = NULL; BLI_array_declare(edges); @@ -587,57 +587,61 @@ BMesh *BM_mesh_copy(BMesh *bmold) BMEditSelection *ese; BMIter iter, liter; int i, j; + BMAllocTemplate allocsize = {bm_old->totvert, + bm_old->totedge, + bm_old->totloop, + bm_old->totface}; /* allocate a bmesh */ - bm = BM_mesh_create(bmold->ob, bm_mesh_allocsize_default); + bm_new = BM_mesh_create(bm_old->ob, &allocsize); - CustomData_copy(&bmold->vdata, &bm->vdata, CD_MASK_BMESH, CD_CALLOC, 0); - CustomData_copy(&bmold->edata, &bm->edata, CD_MASK_BMESH, CD_CALLOC, 0); - CustomData_copy(&bmold->ldata, &bm->ldata, CD_MASK_BMESH, CD_CALLOC, 0); - CustomData_copy(&bmold->pdata, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&bm_old->vdata, &bm_new->vdata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&bm_old->edata, &bm_new->edata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&bm_old->ldata, &bm_new->ldata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&bm_old->pdata, &bm_new->pdata, CD_MASK_BMESH, CD_CALLOC, 0); - CustomData_bmesh_init_pool(&bm->vdata, bm_mesh_allocsize_default[0]); - CustomData_bmesh_init_pool(&bm->edata, bm_mesh_allocsize_default[1]); - CustomData_bmesh_init_pool(&bm->ldata, bm_mesh_allocsize_default[2]); - CustomData_bmesh_init_pool(&bm->pdata, bm_mesh_allocsize_default[3]); + CustomData_bmesh_init_pool(&bm_new->vdata, allocsize.totvert, BM_VERT); + CustomData_bmesh_init_pool(&bm_new->edata, allocsize.totedge, BM_EDGE); + CustomData_bmesh_init_pool(&bm_new->ldata, allocsize.totloop, BM_LOOP); + CustomData_bmesh_init_pool(&bm_new->pdata, allocsize.totface, BM_FACE); - vtable = MEM_mallocN(sizeof(BMVert *) * bmold->totvert, "BM_mesh_copy vtable"); - etable = MEM_mallocN(sizeof(BMEdge *) * bmold->totedge, "BM_mesh_copy etable"); - ftable = MEM_mallocN(sizeof(BMFace *) * bmold->totface, "BM_mesh_copy ftable"); + vtable = MEM_mallocN(sizeof(BMVert *) * bm_old->totvert, "BM_mesh_copy vtable"); + etable = MEM_mallocN(sizeof(BMEdge *) * bm_old->totedge, "BM_mesh_copy etable"); + ftable = MEM_mallocN(sizeof(BMFace *) * bm_old->totface, "BM_mesh_copy ftable"); - v = BM_iter_new(&iter, bmold, BM_VERTS_OF_MESH, NULL); + v = BM_iter_new(&iter, bm_old, BM_VERTS_OF_MESH, NULL); for (i = 0; v; v = BM_iter_step(&iter), i++) { - v2 = BM_vert_create(bm, v->co, NULL); /* copy between meshes so cant use 'example' argument */ - BM_elem_attrs_copy(bmold, bm, v, v2); + v2 = BM_vert_create(bm_new, v->co, NULL); /* copy between meshes so cant use 'example' argument */ + BM_elem_attrs_copy(bm_old, bm_new, v, v2); vtable[i] = v2; BM_elem_index_set(v, i); /* set_inline */ BM_elem_index_set(v2, i); /* set_inline */ } - bmold->elem_index_dirty &= ~BM_VERT; - bm->elem_index_dirty &= ~BM_VERT; + bm_old->elem_index_dirty &= ~BM_VERT; + bm_new->elem_index_dirty &= ~BM_VERT; /* safety check */ - BLI_assert(i == bmold->totvert); + BLI_assert(i == bm_old->totvert); - e = BM_iter_new(&iter, bmold, BM_EDGES_OF_MESH, NULL); + e = BM_iter_new(&iter, bm_old, BM_EDGES_OF_MESH, NULL); for (i = 0; e; e = BM_iter_step(&iter), i++) { - e2 = BM_edge_create(bm, + e2 = BM_edge_create(bm_new, vtable[BM_elem_index_get(e->v1)], vtable[BM_elem_index_get(e->v2)], e, FALSE); - BM_elem_attrs_copy(bmold, bm, e, e2); + BM_elem_attrs_copy(bm_old, bm_new, e, e2); etable[i] = e2; BM_elem_index_set(e, i); /* set_inline */ BM_elem_index_set(e2, i); /* set_inline */ } - bmold->elem_index_dirty &= ~BM_EDGE; - bm->elem_index_dirty &= ~BM_EDGE; + bm_old->elem_index_dirty &= ~BM_EDGE; + bm_new->elem_index_dirty &= ~BM_EDGE; /* safety check */ - BLI_assert(i == bmold->totedge); + BLI_assert(i == bm_old->totedge); - f = BM_iter_new(&iter, bmold, BM_FACES_OF_MESH, NULL); + f = BM_iter_new(&iter, bm_old, BM_FACES_OF_MESH, NULL); for (i = 0; f; f = BM_iter_step(&iter), i++) { BM_elem_index_set(f, i); /* set_inline */ @@ -646,7 +650,7 @@ BMesh *BM_mesh_copy(BMesh *bmold) BLI_array_growitems(loops, f->len); BLI_array_growitems(edges, f->len); - l = BM_iter_new(&liter, bmold, BM_LOOPS_OF_FACE, f); + l = BM_iter_new(&liter, bm_old, BM_LOOPS_OF_FACE, f); for (j = 0; j < f->len; j++, l = BM_iter_step(&liter)) { loops[j] = l; edges[j] = etable[BM_elem_index_get(l->e)]; @@ -660,32 +664,32 @@ BMesh *BM_mesh_copy(BMesh *bmold) v2 = vtable[BM_elem_index_get(loops[0]->v)]; } - f2 = BM_face_create_ngon(bm, v, v2, edges, f->len, FALSE); + f2 = BM_face_create_ngon(bm_new, v, v2, edges, f->len, FALSE); if (!f2) continue; /* use totface incase adding some faces fails */ - BM_elem_index_set(f2, (bm->totface - 1)); /* set_inline */ + BM_elem_index_set(f2, (bm_new->totface - 1)); /* set_inline */ ftable[i] = f2; - BM_elem_attrs_copy(bmold, bm, f, f2); + BM_elem_attrs_copy(bm_old, bm_new, f, f2); copy_v3_v3(f2->no, f->no); - l = BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, f2); + l = BM_iter_new(&liter, bm_new, BM_LOOPS_OF_FACE, f2); for (j = 0; j < f->len; j++, l = BM_iter_step(&liter)) { - BM_elem_attrs_copy(bmold, bm, loops[j], l); + BM_elem_attrs_copy(bm_old, bm_new, loops[j], l); } - if (f == bmold->act_face) bm->act_face = f2; + if (f == bm_old->act_face) bm_new->act_face = f2; } - bmold->elem_index_dirty &= ~BM_FACE; - bm->elem_index_dirty &= ~BM_FACE; + bm_old->elem_index_dirty &= ~BM_FACE; + bm_new->elem_index_dirty &= ~BM_FACE; /* safety check */ - BLI_assert(i == bmold->totface); + BLI_assert(i == bm_old->totface); /* copy over edit selection history */ - for (ese = bmold->selected.first; ese; ese = ese->next) { + for (ese = bm_old->selected.first; ese; ese = ese->next) { void *ele = NULL; if (ese->htype == BM_VERT) @@ -700,7 +704,7 @@ BMesh *BM_mesh_copy(BMesh *bmold) } if (ele) - BM_select_history_store(bm, ele); + BM_select_history_store(bm_new, ele); } MEM_freeN(etable); @@ -710,7 +714,7 @@ BMesh *BM_mesh_copy(BMesh *bmold) BLI_array_free(loops); BLI_array_free(edges); - return bm; + return bm_new; } /* ME -> BM */ diff --git a/source/blender/bmesh/intern/bmesh_construct.h b/source/blender/bmesh/intern/bmesh_construct.h index 8d624592ae7..5c4101c9cde 100644 --- a/source/blender/bmesh/intern/bmesh_construct.h +++ b/source/blender/bmesh/intern/bmesh_construct.h @@ -46,7 +46,7 @@ void BMO_remove_tagged_context(BMesh *bm, const short oflag, const int type); void BM_elem_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, const void *source, void *target); -BMesh *BM_mesh_copy(BMesh *bmold); +BMesh *BM_mesh_copy(BMesh *bm_old); char BM_face_flag_from_mflag(const char mflag); char BM_edge_flag_from_mflag(const short mflag); diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index 2e5b95dc4db..a04e5eda5a2 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -789,7 +789,7 @@ static int count_flagged_radial(BMesh *bm, BMLoop *l, int flag) } i += BM_ELEM_API_FLAG_TEST(l2->f, flag) ? 1 : 0; - l2 = bmesh_radial_loop_next(l2); + l2 = l2->radial_next; if (UNLIKELY(c >= BM_LOOP_RADIAL_MAX)) { BMESH_ASSERT(0); goto error; @@ -944,8 +944,10 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface) #ifdef USE_BMESH_HOLES for (lst = f->loops.first; lst; lst = lst->next) { - if (lst == f->loops.first) continue; - + if (lst == f->loops.first) { + continue; + } + BLI_remlink(&f->loops, lst); BLI_addtail(&holes, lst); } @@ -1450,7 +1452,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou radlen = bmesh_radial_length(ke->l); if (ke->l) { /* first step, fix the neighboring loops of all loops in ke's radial cycl */ - for (i = 0, killoop = ke->l; i < radlen; i++, killoop = bmesh_radial_loop_next(killoop)) { + for (i = 0, killoop = ke->l; i < radlen; i++, killoop = killoop->radial_next) { /* relink loops and fix vertex pointer */ if (killoop->next->v == kv) { killoop->next->v = tv; @@ -1479,7 +1481,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou /* this should be wrapped into a bme_free_radial function to be used by bmesh_KF as well.. */ for (i = 0; i < radlen; i++) { loops[i] = killoop; - killoop = bmesh_radial_loop_next(killoop); + killoop = killoop->radial_next; } for (i = 0; i < radlen; i++) { bm->totloop--; @@ -1506,7 +1508,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou BMESH_ASSERT(edok != FALSE); /* Validate loop cycle of all faces attached to o */ - for (i = 0, l = oe->l; i < radlen; i++, l = bmesh_radial_loop_next(l)) { + for (i = 0, l = oe->l; i < radlen; i++, l = l->radial_next) { BMESH_ASSERT(l->e == oe); edok = bmesh_verts_in_edge(l->v, l->next->v, oe); BMESH_ASSERT(edok != FALSE); @@ -1791,7 +1793,7 @@ static int bm_vert_cut(BMesh *bm, BMVert *v, BMVert ***vout, int *len) continue; } - /* Loops here should alway refer to an edge that has v as an + /* Loops here should always refer to an edge that has v as an * endpoint. For each appearance of this vert in a face, there * will actually be two iterations: one for the loop heading * towards vertex v, and another for the loop heading out from diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index 669426b73a6..d2af98a5e9f 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -720,11 +720,11 @@ static void update_data_blocks(BMesh *bm, CustomData *olddata, CustomData *data) BLI_mempool *oldpool = olddata->pool; void *block; - CustomData_bmesh_init_pool(data, data == &bm->ldata ? 2048 : 512); - if (data == &bm->vdata) { BMVert *eve; - + + CustomData_bmesh_init_pool(data, bm->totvert, BM_VERT); + BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) { block = NULL; CustomData_bmesh_set_default(data, &block); @@ -736,6 +736,8 @@ static void update_data_blocks(BMesh *bm, CustomData *olddata, CustomData *data) else if (data == &bm->edata) { BMEdge *eed; + CustomData_bmesh_init_pool(data, bm->totedge, BM_EDGE); + BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { block = NULL; CustomData_bmesh_set_default(data, &block); @@ -744,31 +746,39 @@ static void update_data_blocks(BMesh *bm, CustomData *olddata, CustomData *data) eed->head.data = block; } } - else if (data == &bm->pdata || data == &bm->ldata) { + else if (data == &bm->ldata) { BMIter liter; BMFace *efa; BMLoop *l; + CustomData_bmesh_init_pool(data, bm->totloop, BM_LOOP); BM_ITER(efa, &iter, bm, BM_FACES_OF_MESH, NULL) { - if (data == &bm->pdata) { + BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, efa) { block = NULL; CustomData_bmesh_set_default(data, &block); - CustomData_bmesh_copy_data(olddata, data, efa->head.data, &block); - CustomData_bmesh_free_block(olddata, &efa->head.data); - efa->head.data = block; + CustomData_bmesh_copy_data(olddata, data, l->head.data, &block); + CustomData_bmesh_free_block(olddata, &l->head.data); + l->head.data = block; } + } + } + else if (data == &bm->pdata) { + BMFace *efa; - if (data == &bm->ldata) { - BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, efa) { - block = NULL; - CustomData_bmesh_set_default(data, &block); - CustomData_bmesh_copy_data(olddata, data, l->head.data, &block); - CustomData_bmesh_free_block(olddata, &l->head.data); - l->head.data = block; - } - } + CustomData_bmesh_init_pool(data, bm->totface, BM_FACE); + + BM_ITER(efa, &iter, bm, BM_FACES_OF_MESH, NULL) { + block = NULL; + CustomData_bmesh_set_default(data, &block); + CustomData_bmesh_copy_data(olddata, data, efa->head.data, &block); + CustomData_bmesh_free_block(olddata, &efa->head.data); + efa->head.data = block; } } + else { + /* should never reach this! */ + BLI_assert(0); + } if (oldpool) { /* this should never happen but can when dissolve fails - [#28960] */ diff --git a/source/blender/bmesh/intern/bmesh_iterators.c b/source/blender/bmesh/intern/bmesh_iterators.c index 6ce0c92a239..9694053e967 100644 --- a/source/blender/bmesh/intern/bmesh_iterators.c +++ b/source/blender/bmesh/intern/bmesh_iterators.c @@ -291,11 +291,13 @@ void *bmiter__loops_of_edge_step(BMIter *iter) { BMLoop *current = iter->nextloop; - if (iter->nextloop) - iter->nextloop = bmesh_radial_loop_next(iter->nextloop); + if (iter->nextloop) { + iter->nextloop = iter->nextloop->radial_next; + } - if (iter->nextloop == iter->firstloop) + if (iter->nextloop == iter->firstloop) { iter->nextloop = NULL; + } if (current) { return current; @@ -314,7 +316,7 @@ void bmiter__loops_of_loop_begin(BMIter *iter) init_iterator(iter); iter->firstloop = l; - iter->nextloop = bmesh_radial_loop_next(iter->firstloop); + iter->nextloop = iter->firstloop->radial_next; if (iter->nextloop == iter->firstloop) iter->nextloop = NULL; @@ -324,9 +326,13 @@ void *bmiter__loops_of_loop_step(BMIter *iter) { BMLoop *current = iter->nextloop; - if (iter->nextloop) iter->nextloop = bmesh_radial_loop_next(iter->nextloop); + if (iter->nextloop) { + iter->nextloop = iter->nextloop->radial_next; + } - if (iter->nextloop == iter->firstloop) iter->nextloop = NULL; + if (iter->nextloop == iter->firstloop) { + iter->nextloop = NULL; + } if (current) { return current; @@ -353,7 +359,9 @@ void *bmiter__face_of_edge_step(BMIter *iter) { BMLoop *current = iter->nextloop; - if (iter->nextloop) iter->nextloop = bmesh_radial_loop_next(iter->nextloop); + if (iter->nextloop) { + iter->nextloop = iter->nextloop->radial_next; + } if (iter->nextloop == iter->firstloop) iter->nextloop = NULL; diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c index 7d64d00e26e..ab1b57a5999 100644 --- a/source/blender/bmesh/intern/bmesh_marking.c +++ b/source/blender/bmesh/intern/bmesh_marking.c @@ -619,7 +619,7 @@ void BM_editselection_plane(BMesh *bm, float r_plane[3], BMEditSelection *ese) * however selecting different edges can swap the direction of the y axis. * this makes it less likely for the y axis of the manipulator * (running along the edge).. to flip less often. - * at least its more pradictable */ + * at least its more predictable */ if (eed->v2->co[1] > eed->v1->co[1]) { /* check which to do first */ sub_v3_v3v3(r_plane, eed->v2->co, eed->v1->co); } @@ -854,7 +854,7 @@ void BM_edge_hide_set(BMesh *bm, BMEdge *e, int hide) BM_elem_flag_set(e, BM_ELEM_HIDDEN, hide); - /* hide vertices if necassary */ + /* hide vertices if necessary */ vert_flush_hide_set(bm, e->v1); vert_flush_hide_set(bm, e->v2); } diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index c791b392a82..944b3b434c7 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -44,21 +44,22 @@ #include "bmesh_private.h" /* used as an extern, defined in bmesh.h */ -int bm_mesh_allocsize_default[4] = {512, 512, 2048, 512}; +BMAllocTemplate bm_mesh_allocsize_default = {512, 1024, 2048, 512}; +BMAllocTemplate bm_mesh_chunksize_default = {512, 1024, 2048, 512}; -static void bm_mempool_init(BMesh *bm, const int allocsize[4]) +static void bm_mempool_init(BMesh *bm, const BMAllocTemplate *allocsize) { - bm->vpool = BLI_mempool_create(sizeof(BMVert), allocsize[0], allocsize[0], FALSE, TRUE); - bm->epool = BLI_mempool_create(sizeof(BMEdge), allocsize[1], allocsize[1], FALSE, TRUE); - bm->lpool = BLI_mempool_create(sizeof(BMLoop), allocsize[2], allocsize[2], FALSE, FALSE); - bm->fpool = BLI_mempool_create(sizeof(BMFace), allocsize[3], allocsize[3], FALSE, TRUE); + bm->vpool = BLI_mempool_create(sizeof(BMVert), allocsize->totvert, bm_mesh_chunksize_default.totvert, BLI_MEMPOOL_ALLOW_ITER); + bm->epool = BLI_mempool_create(sizeof(BMEdge), allocsize->totedge, bm_mesh_chunksize_default.totedge, BLI_MEMPOOL_ALLOW_ITER); + bm->lpool = BLI_mempool_create(sizeof(BMLoop), allocsize->totloop, bm_mesh_chunksize_default.totloop, 0); + bm->fpool = BLI_mempool_create(sizeof(BMFace), allocsize->totface, bm_mesh_chunksize_default.totface, BLI_MEMPOOL_ALLOW_ITER); #ifdef USE_BMESH_HOLES bm->looplistpool = BLI_mempool_create(sizeof(BMLoopList), allocsize[3], allocsize[3], FALSE, FALSE); #endif /* allocate one flag pool that we dont get rid of. */ - bm->toolflagpool = BLI_mempool_create(sizeof(BMFlagLayer), 512, 512, FALSE, FALSE); + bm->toolflagpool = BLI_mempool_create(sizeof(BMFlagLayer), 512, 512, 0); } /** @@ -70,7 +71,7 @@ static void bm_mempool_init(BMesh *bm, const int allocsize[4]) * * \note ob is needed by multires */ -BMesh *BM_mesh_create(struct Object *ob, const int allocsize[4]) +BMesh *BM_mesh_create(struct Object *ob, BMAllocTemplate *allocsize) { /* allocate the structure */ BMesh *bm = MEM_callocN(sizeof(BMesh), __func__); @@ -145,7 +146,7 @@ void BM_mesh_data_free(BMesh *bm) BLI_mempool_destroy(bm->looplistpool); #endif - /* These tables aren't used yet, so it's not stricly necessary + /* These tables aren't used yet, so it's not strictly necessary * to 'end' them (with 'e' param) but if someone tries to start * using them, having these in place will save a lot of pain */ mesh_octree_table(NULL, NULL, NULL, 'e'); @@ -153,6 +154,13 @@ void BM_mesh_data_free(BMesh *bm) BLI_freelistN(&bm->selected); + if (bm->py_handle) { + extern void bpy_bm_generic_invalidate(void *self); + + bpy_bm_generic_invalidate(bm->py_handle); + bm->py_handle = NULL; + } + BMO_error_clear(bm); } @@ -173,7 +181,7 @@ void BM_mesh_clear(BMesh *bm) bm->ob = ob; /* allocate the memory pools for the mesh elements */ - bm_mempool_init(bm, bm_mesh_allocsize_default); + bm_mempool_init(bm, &bm_mesh_allocsize_default); bm->stackdepth = 1; bm->totflags = 1; diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h index 373b530894a..d045cd8be90 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.h +++ b/source/blender/bmesh/intern/bmesh_mesh.h @@ -27,7 +27,9 @@ * \ingroup bmesh */ -BMesh *BM_mesh_create(struct Object *ob, const int allocsize[4]); +struct BMAllocTemplate; + +BMesh *BM_mesh_create(struct Object *ob, struct BMAllocTemplate *allocsize); void BM_mesh_free(BMesh *bm); void BM_mesh_data_free(BMesh *bm); @@ -46,4 +48,11 @@ BMVert *BM_vert_at_index(BMesh *bm, const int index); BMEdge *BM_edge_at_index(BMesh *bm, const int index); BMFace *BM_face_at_index(BMesh *bm, const int index); +typedef struct BMAllocTemplate { + int totvert, totedge, totloop, totface; +} BMAllocTemplate; + +extern BMAllocTemplate bm_mesh_allocsize_default; +extern BMAllocTemplate bm_mesh_chunksize_default; + #endif /* __BMESH_MESH_H__ */ diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index 59c12e2d9f2..ae53d5f83e4 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -206,7 +206,7 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v) /** * \brief Faces Join Pair * - * Joins two adjacenct faces togather. + * Joins two adjacent faces togather. * * Because this method calls to #BM_faces_join to do its work, if a pair * of faces share multiple edges, the pair of faces will be joined at diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index f6b066ca763..37df243d3fc 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -353,7 +353,7 @@ static BMOpDefine bmo_weldverts_def = { /* * Make Vertex * - * Creates a single vertex; this bmop was necassary + * Creates a single vertex; this bmop was necessary * for click-create-vertex. */ static BMOpDefine bmo_makevert_def = { @@ -454,7 +454,7 @@ static BMOpDefine bmo_edgenet_prepare_def = { * Rotate * * Rotate vertices around a center, using a 3x3 rotation - * matrix. Equivilent of the old rotateflag function. + * matrix. Equivalent of the old rotateflag function. */ static BMOpDefine bmo_rotate_def = { "rotate", @@ -469,7 +469,7 @@ static BMOpDefine bmo_rotate_def = { /* * Translate * - * Translate vertices by an offset. Equivelent of the + * Translate vertices by an offset. Equivalent of the * old translateflag function. */ static BMOpDefine bmo_translate_def = { @@ -536,7 +536,7 @@ static BMOpDefine bmo_bmesh_to_mesh_def = { "bmesh_to_mesh", {{BMO_OP_SLOT_PNT, "mesh"}, //pointer to a mesh structure to fill in {BMO_OP_SLOT_PNT, "object"}, //pointer to an object structure - {BMO_OP_SLOT_BOOL, "notesselation"}, //don't calculate mfaces + {BMO_OP_SLOT_BOOL, "notessellation"}, //don't calculate mfaces {0, /* null-terminating sentine */}}, bmo_bmesh_to_mesh_exec, 0, diff --git a/source/blender/bmesh/intern/bmesh_operator_api_inline.c b/source/blender/bmesh/intern/bmesh_operator_api_inline.c index 88789fc24b0..5b88d9f1b96 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api_inline.c +++ b/source/blender/bmesh/intern/bmesh_operator_api_inline.c @@ -80,7 +80,7 @@ BM_INLINE void BMO_slot_map_float_insert(BMesh *bm, BMOperator *op, const char * } -/* pointer versoins of BMO_slot_map_float_get and BMO_slot_map_float_insert. +/* pointer versions of BMO_slot_map_float_get and BMO_slot_map_float_insert. * * do NOT use these for non-operator-api-allocated memory! instead * use BMO_slot_map_data_get and BMO_slot_map_insert, which copies the data. */ @@ -88,15 +88,15 @@ BM_INLINE void BMO_slot_map_float_insert(BMesh *bm, BMOperator *op, const char * BM_INLINE void BMO_slot_map_ptr_insert(BMesh *bm, BMOperator *op, const char *slotname, void *element, void *val) { - BMO_slot_map_insert(bm, op, slotname, element, &val, sizeof(void*)); + BMO_slot_map_insert(bm, op, slotname, element, &val, sizeof(void *)); } BM_INLINE int BMO_slot_map_contains(BMesh *UNUSED(bm), BMOperator *op, const char *slotname, void *element) { BMOpSlot *slot = BMO_slot_get(op, slotname); + BLI_assert(slot->slottype == BMO_OP_SLOT_MAPPING); - /*sanity check*/ - if (slot->slottype != BMO_OP_SLOT_MAPPING) return 0; + /* sanity check */ if (!slot->data.ghash) return 0; return BLI_ghash_haskey(slot->data.ghash, element); @@ -107,9 +107,9 @@ BM_INLINE void *BMO_slot_map_data_get(BMesh *UNUSED(bm), BMOperator *op, const c { BMOElemMapping *mapping; BMOpSlot *slot = BMO_slot_get(op, slotname); + BLI_assert(slot->slottype == BMO_OP_SLOT_MAPPING); - /*sanity check*/ - if (slot->slottype != BMO_OP_SLOT_MAPPING) return NULL; + /* sanity check */ if (!slot->data.ghash) return NULL; mapping = (BMOElemMapping *)BLI_ghash_lookup(slot->data.ghash, element); @@ -122,7 +122,7 @@ BM_INLINE void *BMO_slot_map_data_get(BMesh *UNUSED(bm), BMOperator *op, const c BM_INLINE float BMO_slot_map_float_get(BMesh *bm, BMOperator *op, const char *slotname, void *element) { - float *val = (float*) BMO_slot_map_data_get(bm, op, slotname, element); + float *val = (float *) BMO_slot_map_data_get(bm, op, slotname, element); if (val) return *val; return 0.0f; @@ -131,7 +131,7 @@ BM_INLINE float BMO_slot_map_float_get(BMesh *bm, BMOperator *op, const char *sl BM_INLINE int BMO_slot_map_int_get(BMesh *bm, BMOperator *op, const char *slotname, void *element) { - int *val = (int*) BMO_slot_map_data_get(bm, op, slotname, element); + int *val = (int *) BMO_slot_map_data_get(bm, op, slotname, element); if (val) return *val; return 0; @@ -140,7 +140,7 @@ BM_INLINE int BMO_slot_map_int_get(BMesh *bm, BMOperator *op, const char *slotna BM_INLINE void *BMO_slot_map_ptr_get(BMesh *bm, BMOperator *op, const char *slotname, void *element) { - void **val = (void**) BMO_slot_map_data_get(bm, op, slotname, element); + void **val = (void **) BMO_slot_map_data_get(bm, op, slotname, element); if (val) return *val; return NULL; diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index 9d6d7fce15a..911c3872161 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -55,7 +55,7 @@ static const char *bmo_error_messages[] = { "Could not traverse mesh", "Could not dissolve faces", "Could not dissolve vertices", - "Tesselation error", + "Tessellation error", "Can not deal with non-manifold geometry", "Invalid selection", "Internal mesh error", @@ -153,8 +153,8 @@ void BMO_op_init(BMesh *bm, BMOperator *op, const char *opname) op->exec = opdefines[opcode]->exec; /* memarena, used for operator's slot buffers */ - op->arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "bmesh operator"); - BLI_memarena_use_calloc (op->arena); + op->arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__); + BLI_memarena_use_calloc(op->arena); } /** @@ -248,44 +248,46 @@ void BMO_slot_copy(BMOperator *source_op, BMOperator *dest_op, const char *src, if (source_slot == dest_slot) return; - if (source_slot->slottype != dest_slot->slottype) + if (source_slot->slottype != dest_slot->slottype) { + /* possibly assert here? */ return; - - if (dest_slot->slottype > BMO_OP_SLOT_VEC) { - if (dest_slot->slottype != BMO_OP_SLOT_MAPPING) { - /* do buffer copy */ - dest_slot->data.buf = NULL; - dest_slot->len = source_slot->len; - if (dest_slot->len) { - const int slot_alloc_size = BMO_OPSLOT_TYPEINFO[dest_slot->slottype] * dest_slot->len; - dest_slot->data.buf = BLI_memarena_alloc(dest_op->arena, slot_alloc_size); - memcpy(dest_slot->data.buf, source_slot->data.buf, slot_alloc_size); - } + } + + if (dest_slot->slottype == BMO_OP_SLOT_ELEMENT_BUF) { + /* do buffer copy */ + dest_slot->data.buf = NULL; + dest_slot->len = source_slot->len; + if (dest_slot->len) { + const int slot_alloc_size = BMO_OPSLOT_TYPEINFO[dest_slot->slottype] * dest_slot->len; + dest_slot->data.buf = BLI_memarena_alloc(dest_op->arena, slot_alloc_size); + memcpy(dest_slot->data.buf, source_slot->data.buf, slot_alloc_size); } - else { - GHashIterator it; - BMOElemMapping *srcmap, *dstmap; + } + else if (dest_slot->slottype == BMO_OP_SLOT_MAPPING) { + GHashIterator it; + BMOElemMapping *srcmap, *dstmap; - /* sanity check */ - if (!source_slot->data.ghash) return; - - if (!dest_slot->data.ghash) { - dest_slot->data.ghash = BLI_ghash_new(BLI_ghashutil_ptrhash, - BLI_ghashutil_ptrcmp, "bmesh operator 2"); - } + /* sanity check */ + if (!source_slot->data.ghash) { + return; + } + + if (!dest_slot->data.ghash) { + dest_slot->data.ghash = BLI_ghash_new(BLI_ghashutil_ptrhash, + BLI_ghashutil_ptrcmp, "bmesh operator 2"); + } - BLI_ghashIterator_init(&it, source_slot->data.ghash); - for ( ; (srcmap = BLI_ghashIterator_getValue(&it)); - BLI_ghashIterator_step(&it)) - { - dstmap = BLI_memarena_alloc(dest_op->arena, sizeof(*dstmap) + srcmap->len); + BLI_ghashIterator_init(&it, source_slot->data.ghash); + for ( ; (srcmap = BLI_ghashIterator_getValue(&it)); + BLI_ghashIterator_step(&it)) + { + dstmap = BLI_memarena_alloc(dest_op->arena, sizeof(*dstmap) + srcmap->len); - dstmap->element = srcmap->element; - dstmap->len = srcmap->len; - memcpy(dstmap + 1, srcmap + 1, srcmap->len); + dstmap->element = srcmap->element; + dstmap->len = srcmap->len; + memcpy(dstmap + 1, srcmap + 1, srcmap->len); - BLI_ghash_insert(dest_slot->data.ghash, dstmap->element, dstmap); - } + BLI_ghash_insert(dest_slot->data.ghash, dstmap->element, dstmap); } } else { @@ -502,13 +504,13 @@ void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *UNUSED(op), const char hty } } -int BMO_slot_buf_count(BMesh *UNUSED(bm), BMOperator *op, const char *slotname) +int BMO_slot_buffer_count(BMesh *UNUSED(bm), BMOperator *op, const char *slotname) { BMOpSlot *slot = BMO_slot_get(op, slotname); - BLI_assert(slot->slottype > BMO_OP_SLOT_VEC); + BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); /* check if its actually a buffer */ - if (!(slot->slottype > BMO_OP_SLOT_VEC)) + if (slot->slottype != BMO_OP_SLOT_ELEMENT_BUF) return 0; return slot->len; @@ -534,11 +536,7 @@ void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slotname { BMOElemMapping *mapping; BMOpSlot *slot = BMO_slot_get(op, slotname); - - /*sanity check*/ - if (slot->slottype != BMO_OP_SLOT_MAPPING) { - return; - } + BLI_assert(slot->slottype == BMO_OP_SLOT_MAPPING); mapping = (BMOElemMapping *) BLI_memarena_alloc(op->arena, sizeof(*mapping) + len); @@ -555,14 +553,16 @@ void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slotname } #if 0 -void *BMO_Grow_Array(BMesh *bm, BMOperator *op, int slotcode, int totadd) +void *bmo_slot_buffer_grow(BMesh *bm, BMOperator *op, int slotcode, int totadd) { BMOpSlot *slot = &op->slots[slotcode]; void *tmp; ssize_t allocsize; + BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); + /* check if its actually a buffer */ - if (!(slot->slottype > BMO_OP_SLOT_VEC)) + if (slot->slottype != BMO_OP_SLOT_ELEMENT_BUF) return NULL; if (slot->flag & BMOS_DYNAMIC_ARRAY) { @@ -595,8 +595,8 @@ void *BMO_Grow_Array(BMesh *bm, BMOperator *op, int slotcode, int totadd) } #endif -void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op, - const char *slotname, const short oflag) +void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op, const char *slotname, + const short oflag, const char htype) { GHashIterator it; BMOpSlot *slot = BMO_slot_get(op, slotname); @@ -605,23 +605,23 @@ void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op, BLI_assert(slot->slottype == BMO_OP_SLOT_MAPPING); /* sanity check */ - if (slot->slottype != BMO_OP_SLOT_MAPPING) return; if (!slot->data.ghash) return; BLI_ghashIterator_init(&it, slot->data.ghash); for ( ; (ele_f = BLI_ghashIterator_getKey(&it)); BLI_ghashIterator_step(&it)) { - BMO_elem_flag_enable(bm, ele_f, oflag); + if (ele_f->head.htype & htype) { + BMO_elem_flag_enable(bm, ele_f, oflag); + } } } static void *bmo_slot_buffer_alloc(BMOperator *op, const char *slotname, int len) { BMOpSlot *slot = BMO_slot_get(op, slotname); - - BLI_assert(slot->slottype > BMO_OP_SLOT_VEC); + BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); /* check if its actually a buffer */ - if (!(slot->slottype > BMO_OP_SLOT_VEC)) + if (slot->slottype != BMO_OP_SLOT_ELEMENT_BUF) return NULL; slot->len = len; @@ -635,7 +635,7 @@ static void *bmo_slot_buffer_alloc(BMOperator *op, const char *slotname, int len * * Copies all elements of a certain type into an operator slot. */ -static void BMO_slot_from_all(BMesh *bm, BMOperator *op, const char *slotname, const char htype) +static void BMO_slot_buffer_from_all(BMesh *bm, BMOperator *op, const char *slotname, const char htype) { BMIter elements; BMHeader *e; @@ -678,7 +678,7 @@ static void BMO_slot_from_all(BMesh *bm, BMOperator *op, const char *slotname, c * Copies elements of a certain type, which have a certain header flag set * into a slot for an operator. */ -void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, +void BMO_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, const char hflag, const char htype) { BMIter elements; @@ -686,7 +686,7 @@ void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, BMOpSlot *output = BMO_slot_get(op, slotname); int totelement = 0, i = 0; - totelement = BM_mesh_count_flag(bm, htype, hflag, 1); + totelement = BM_mesh_count_flag(bm, htype, hflag, TRUE); if (totelement) { bmo_slot_buffer_alloc(op, slotname, totelement); @@ -729,23 +729,27 @@ void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, * Copies elements of a certain type, which have a certain flag set * into an output slot for an operator. */ -void BMO_slot_from_flag(BMesh *bm, BMOperator *op, const char *slotname, - const short oflag, const char htype) +void BMO_slot_buffer_from_flag(BMesh *bm, BMOperator *op, const char *slotname, + const short oflag, const char htype) { BMIter elements; - BMHeader *ele; - BMOpSlot *output = BMO_slot_get(op, slotname); + BMOpSlot *slot = BMO_slot_get(op, slotname); int totelement = BMO_mesh_flag_count(bm, oflag, htype), i = 0; - BLI_assert(output->slottype > BMO_OP_SLOT_VEC); + BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); if (totelement) { + BMHeader *ele; + BMHeader **ele_array; + bmo_slot_buffer_alloc(op, slotname, totelement); + ele_array = (BMHeader **)slot->data.p; + if (htype & BM_VERT) { for (ele = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) { if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag)) { - ((BMHeader **)output->data.p)[i] = ele; + ele_array[i] = ele; i++; } } @@ -754,7 +758,7 @@ void BMO_slot_from_flag(BMesh *bm, BMOperator *op, const char *slotname, if (htype & BM_EDGE) { for (ele = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) { if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag)) { - ((BMHeader **)output->data.p)[i] = ele; + ele_array[i] = ele; i++; } } @@ -763,14 +767,14 @@ void BMO_slot_from_flag(BMesh *bm, BMOperator *op, const char *slotname, if (htype & BM_FACE) { for (ele = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) { if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag)) { - ((BMHeader **)output->data.p)[i] = ele; + ele_array[i] = ele; i++; } } } } else { - output->len = 0; + slot->len = 0; } } @@ -787,7 +791,7 @@ void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotnam BMElem **data = slot->data.p; int i; - BLI_assert(slot->slottype > BMO_OP_SLOT_VEC); + BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); if (!(hflag & BM_ELEM_SELECT)) { do_flush_select = FALSE; @@ -817,7 +821,7 @@ void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotna BMElem **data = slot->data.p; int i; - BLI_assert(slot->slottype > BMO_OP_SLOT_VEC); + BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); if (!(hflag & BM_ELEM_SELECT)) { do_flush_select = FALSE; @@ -865,7 +869,7 @@ void BMO_slot_buffer_flag_enable(BMesh *bm, BMOperator *op, const char *slotname BMHeader **data = slot->data.p; int i; - BLI_assert(slot->slottype > BMO_OP_SLOT_VEC); + BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); for (i = 0; i < slot->len; i++) { if (!(htype & data[i]->htype)) @@ -886,7 +890,9 @@ void BMO_slot_buffer_flag_disable(BMesh *bm, BMOperator *op, const char *slotnam BMOpSlot *slot = BMO_slot_get(op, slotname); BMHeader **data = slot->data.p; int i; - + + BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); + for (i = 0; i < slot->len; i++) { if (!(htype & data[i]->htype)) continue; @@ -927,7 +933,7 @@ static void bmo_flag_layer_alloc(BMesh *bm) bm->totflags++; /* allocate new flag poo */ - bm->toolflagpool = newpool = BLI_mempool_create(sizeof(BMFlagLayer) * bm->totflags, 512, 512, FALSE, FALSE); + bm->toolflagpool = newpool = BLI_mempool_create(sizeof(BMFlagLayer) * bm->totflags, 512, 512, 0); /* now go through and memcpy all the flags. Loops don't get a flag layer at this time.. */ for (ele = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) { @@ -972,7 +978,7 @@ static void bmo_flag_layer_free(BMesh *bm) /* de-increment the totflags first.. */ bm->totflags--; /* allocate new flag poo */ - bm->toolflagpool = newpool = BLI_mempool_create(new_totflags_size, 512, 512, TRUE, FALSE); + bm->toolflagpool = newpool = BLI_mempool_create(new_totflags_size, 512, 512, BLI_MEMPOOL_SYSMALLOC); /* now go through and memcpy all the flag */ for (ele = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) { @@ -1026,7 +1032,7 @@ static void bmo_flag_layer_clear(BMesh *bm) bm->elem_index_dirty &= ~(BM_VERT|BM_EDGE|BM_FACE); } -void *BMO_slot_elem_first(BMOperator *op, const char *slotname) +void *BMO_slot_buffer_elem_first(BMOperator *op, const char *slotname) { BMOpSlot *slot = BMO_slot_get(op, slotname); @@ -1371,13 +1377,13 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist) } if (type == 'h') { - BMO_slot_from_hflag(bm, op, slotname, va_arg(vlist, int), ret); + BMO_slot_buffer_from_hflag(bm, op, slotname, va_arg(vlist, int), ret); } else if (type == 'a') { - BMO_slot_from_all(bm, op, slotname, ret); + BMO_slot_buffer_from_all(bm, op, slotname, ret); } else { - BMO_slot_from_flag(bm, op, slotname, va_arg(vlist, int), ret); + BMO_slot_buffer_from_flag(bm, op, slotname, va_arg(vlist, int), ret); } } diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index 9515089a4a6..f6111e75e80 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -25,7 +25,7 @@ * * This file contains code for dealing * with polygons (normal/area calculation, - * tesselation, etc) + * tessellation, etc) * * BMESH_TODO: * - Add in Tesselator frontend that creates @@ -959,7 +959,9 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len) shrink_edgef(v1, v2, fac1); for (j = 0; j < len; j++) { - if (!loops[j][0]) continue; + if (!loops[j][0]) { + continue; + } p3 = edgeverts[j * 2]; p4 = edgeverts[j * 2 + 1]; @@ -972,22 +974,20 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len) for (i = 0; i < len; i++) { for (j = 0; j < len; j++) { - if (j == i) continue; - if (!loops[i][0]) continue; - if (!loops[j][0]) continue; + if (j != i && loops[i][0] && loops[j][0]) { + p1 = edgeverts[i * 2]; + p2 = edgeverts[i * 2 + 1]; + p3 = edgeverts[j * 2]; + p4 = edgeverts[j * 2 + 1]; - p1 = edgeverts[i * 2]; - p2 = edgeverts[i * 2 + 1]; - p3 = edgeverts[j * 2]; - p4 = edgeverts[j * 2 + 1]; + copy_v3_v3(v1, p1); + copy_v3_v3(v2, p2); - copy_v3_v3(v1, p1); - copy_v3_v3(v2, p2); + shrink_edgef(v1, v2, fac1); - shrink_edgef(v1, v2, fac1); - - if (linecrossesf(v1, v2, p3, p4)) { - loops[i][0] = NULL; + if (linecrossesf(v1, v2, p3, p4)) { + loops[i][0] = NULL; + } } } } diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index 28c370f51eb..e597145a54c 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -204,13 +204,16 @@ int BM_vert_edge_count(BMVert *v) int BM_edge_face_count(BMEdge *e) { int count = 0; - BMLoop *l_iter = NULL; if (e->l) { - l_iter = e->l; + BMLoop *l_iter; + BMLoop *l_first; + + l_iter = l_first = e->l; + do { count++; - } while ((l_iter = bmesh_radial_loop_next(l_iter)) != e->l); + } while ((l_iter = l_iter->radial_next) != l_first); } return count; @@ -348,27 +351,50 @@ int BM_vert_is_manifold(BMesh *UNUSED(bm), BMVert *v) * Tests whether or not this edge is manifold. * A manifold edge either has 1 or 2 faces attached to it. */ + +#if 1 /* fast path for checking manifold */ +int BM_edge_is_manifold(BMesh *UNUSED(bm), BMEdge *e) +{ + const BMLoop *l = e->l; + return (l && ((l->radial_next == l) || /* 1 face user */ + (l->radial_next->radial_next == l))); /* 2 face users */ +} +#else int BM_edge_is_manifold(BMesh *UNUSED(bm), BMEdge *e) { int count = BM_edge_face_count(e); - if (count != 2 && count != 1) { + if (count == 2 || count == 1) { + return TRUE; + } + else { return FALSE; } - return TRUE; } +#endif /** * Tests whether or not an edge is on the boundary * of a shell (has one face associated with it) */ + +#if 1 /* fast path for checking boundry */ +int BM_edge_is_boundary(BMEdge *e) +{ + const BMLoop *l = e->l; + return (l && (l->radial_next == l)); +} +#else int BM_edge_is_boundary(BMEdge *e) { int count = BM_edge_face_count(e); if (count == 1) { return TRUE; } - return FALSE; + else { + return FALSE; + } } +#endif /** * Counts the number of edges two faces share (if any) diff --git a/source/blender/bmesh/intern/bmesh_structure.c b/source/blender/bmesh/intern/bmesh_structure.c index 191b9c29f01..ad6a8a615e3 100644 --- a/source/blender/bmesh/intern/bmesh_structure.c +++ b/source/blender/bmesh/intern/bmesh_structure.c @@ -107,7 +107,7 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv) * some nice utilities for navigating disk cycles in a way that hides this detail from the * tool writer. * - * Note that the disk cycle is completley independent from face data. One advantage of this + * Note that the disk cycle is completely independent from face data. One advantage of this * is that wire edges are fully integrated into the topology database. Another is that the * the disk cycle has no problems dealing with non-manifold conditions involving faces. * @@ -131,7 +131,6 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv) * Functions relating to this cycle: * - #bmesh_radial_append * - #bmesh_radial_loop_remove - * - #bmesh_radial_loop_next * - #bmesh_radial_face_find * - #bmesh_radial_facevert_count * - #bmesh_radial_faceloop_find_first @@ -152,7 +151,7 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv) * * \note the order of elements in all cycles except the loop cycle is undefined. This * leads to slightly increased seek time for deriving some adjacency relations, however the - * advantage is that no intrinsic properties of the data structures are dependant upon the + * advantage is that no intrinsic properties of the data structures are dependent upon the * cycle order and all non-manifold conditions are represented trivially. */ int bmesh_disk_edge_append(BMEdge *e, BMVert *v) @@ -234,7 +233,7 @@ BMEdge *bmesh_disk_edge_exists(BMVert *v1, BMVert *v2) BMEdge *e_iter, *e_first; if (v1->e) { - e_first = e_iter= v1->e; + e_first = e_iter = v1->e; do { if (bmesh_verts_in_edge(v1, v2, e_iter)) { @@ -379,7 +378,7 @@ int bmesh_radial_validate(int radlen, BMLoop *l) } i++; - } while ((l_iter = bmesh_radial_loop_next(l_iter)) != l); + } while ((l_iter = l_iter->radial_next) != l); return TRUE; } @@ -438,27 +437,22 @@ BMLoop *bmesh_radial_faceloop_find_first(BMLoop *l, BMVert *v) if (l_iter->v == v) { return l_iter; } - } while ((l_iter = bmesh_radial_loop_next(l_iter)) != l); + } while ((l_iter = l_iter->radial_next) != l); return NULL; } BMLoop *bmesh_radial_faceloop_find_next(BMLoop *l, BMVert *v) { BMLoop *l_iter; - l_iter = bmesh_radial_loop_next(l); + l_iter = l->radial_next; do { if (l_iter->v == v) { return l_iter; } - } while ((l_iter = bmesh_radial_loop_next(l_iter)) != l); + } while ((l_iter = l_iter->radial_next) != l); return l; } -BMLoop *bmesh_radial_loop_next(BMLoop *l) -{ - return l->radial_next; -} - int bmesh_radial_length(BMLoop *l) { BMLoop *l_iter = l; @@ -536,7 +530,7 @@ int bmesh_radial_facevert_count(BMLoop *l, BMVert *v) if (l_iter->v == v) { count++; } - } while ((l_iter = bmesh_radial_loop_next(l_iter)) != l); + } while ((l_iter = l_iter->radial_next) != l); return count; } diff --git a/source/blender/bmesh/intern/bmesh_structure.h b/source/blender/bmesh/intern/bmesh_structure.h index 8e82f3cd2d7..c3780a5dede 100644 --- a/source/blender/bmesh/intern/bmesh_structure.h +++ b/source/blender/bmesh/intern/bmesh_structure.h @@ -35,7 +35,7 @@ * None of these functions should ever be exported to the rest of Blender. * * in the vast majority of cases thes should not be used directly. - * if absolutely necassary, see function defitions in code for + * if absolutely necessary, see function definitions in code for * descriptive comments. but seriously, don't use this stuff. */ @@ -56,7 +56,10 @@ BMEdge *bmesh_disk_faceedge_find_next(BMEdge *e, BMVert *v); /* RADIAL CYCLE MANAGMENT */ void bmesh_radial_append(BMEdge *e, BMLoop *l); void bmesh_radial_loop_remove(BMLoop *l, BMEdge *e); -BMLoop *bmesh_radial_loop_next(BMLoop *l); +/* note: + * bmesh_radial_loop_next(BMLoop *l) / prev. + * just use member access l->radial_next, l->radial_prev now */ + int bmesh_radial_face_find(BMEdge *e, BMFace *f); int bmesh_radial_facevert_count(BMLoop *l, BMVert *v); BMLoop *bmesh_radial_faceloop_find_first(BMLoop *l, BMVert *v); diff --git a/source/blender/bmesh/intern/bmesh_walkers.c b/source/blender/bmesh/intern/bmesh_walkers.c index 2e2c0406b9c..029bc35f2e7 100644 --- a/source/blender/bmesh/intern/bmesh_walkers.c +++ b/source/blender/bmesh/intern/bmesh_walkers.c @@ -27,8 +27,7 @@ */ #include <stdlib.h> - - +#include <string.h> /* for memcpy */ #include "BLI_listbase.h" @@ -42,7 +41,7 @@ * * original desing: walkers directly emulation recursive functions. * functions save their state onto a worklist, and also add new states - * to implement recursive or looping behaviour. generally only one + * to implement recursive or looping behavior. generally only one * state push per call with a specific state is desired. * * basic design pattern: the walker step function goes through it's @@ -53,8 +52,8 @@ * - Walkers use tool flags, not header flags. * - Walkers now use ghash for storing visited elements, * rather then stealing flags. ghash can be rewritten - * to be faster if necassary, in the far future :) . - * - tools should ALWAYS have necassary error handling + * to be faster if necessary, in the far future :) . + * - tools should ALWAYS have necessary error handling * for if walkers fail. */ @@ -113,7 +112,7 @@ void BMW_init(BMWalker *walker, BMesh *bm, int type, BLI_assert(mask_face == 0 || (walker->valid_mask & BM_FACE)); } - walker->worklist = BLI_mempool_create(walker->structsize, 100, 100, TRUE, FALSE); + walker->worklist = BLI_mempool_create(walker->structsize, 100, 100, BLI_MEMPOOL_SYSMALLOC); walker->states.first = walker->states.last = NULL; } @@ -179,7 +178,7 @@ void *BMW_walk(BMWalker *walker) */ void *BMW_current_state(BMWalker *walker) { - bmesh_walkerGeneric *currentstate = walker->states.first; + BMwGenericWalker *currentstate = walker->states.first; if (currentstate) { /* Automatic update of depth. For most walkers that * follow the standard "Step" pattern of: @@ -221,7 +220,7 @@ void BMW_state_remove(BMWalker *walker) */ void *BMW_state_add(BMWalker *walker) { - bmesh_walkerGeneric *newstate; + BMwGenericWalker *newstate; newstate = BLI_mempool_alloc(walker->worklist); newstate->depth = walker->depth; switch (walker->order) diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c index 73aa42dbbdc..23cc18c8e26 100644 --- a/source/blender/bmesh/intern/bmesh_walkers_impl.c +++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c @@ -40,9 +40,9 @@ * * \todo Add restriction flag/callback for wire edges. */ -static void shellWalker_visitEdge(BMWalker *walker, BMEdge *e) +static void bmw_ShellWalker_visitEdge(BMWalker *walker, BMEdge *e) { - shellWalker *shellWalk = NULL; + BMwShellWalker *shellWalk = NULL; if (BLI_ghash_haskey(walker->visithash, e)) { return; @@ -57,7 +57,7 @@ static void shellWalker_visitEdge(BMWalker *walker, BMEdge *e) BLI_ghash_insert(walker->visithash, e, NULL); } -static void shellWalker_begin(BMWalker *walker, void *data) +static void bmw_ShellWalker_begin(BMWalker *walker, void *data) { BMIter eiter; BMHeader *h = data; @@ -75,7 +75,7 @@ static void shellWalker_begin(BMWalker *walker, void *data) * to the worklist */ v = (BMVert *)h; BM_ITER(e, &eiter, walker->bm, BM_EDGES_OF_VERT, v) { - shellWalker_visitEdge(walker, e); + bmw_ShellWalker_visitEdge(walker, e); } break; } @@ -85,21 +85,21 @@ static void shellWalker_begin(BMWalker *walker, void *data) /* starting the walk at an edge, add the single edge * to the worklist */ e = (BMEdge *)h; - shellWalker_visitEdge(walker, e); + bmw_ShellWalker_visitEdge(walker, e); break; } } } -static void *shellWalker_yield(BMWalker *walker) +static void *bmw_ShellWalker_yield(BMWalker *walker) { - shellWalker *shellWalk = BMW_current_state(walker); + BMwShellWalker *shellWalk = BMW_current_state(walker); return shellWalk->curedge; } -static void *shellWalker_step(BMWalker *walker) +static void *bmw_ShellWalker_step(BMWalker *walker) { - shellWalker *swalk = BMW_current_state(walker); + BMwShellWalker *swalk = BMW_current_state(walker); BMEdge *e, *e2; BMVert *v; BMIter iter; @@ -111,7 +111,7 @@ static void *shellWalker_step(BMWalker *walker) for (i = 0; i < 2; i++) { v = i ? e->v2 : e->v1; BM_ITER(e2, &iter, walker->bm, BM_EDGES_OF_VERT, v) { - shellWalker_visitEdge(walker, e2); + bmw_ShellWalker_visitEdge(walker, e2); } } @@ -119,12 +119,12 @@ static void *shellWalker_step(BMWalker *walker) } #if 0 -static void *shellWalker_step(BMWalker *walker) +static void *bmw_ShellWalker_step(BMWalker *walker) { BMEdge *curedge, *next = NULL; BMVert *ov = NULL; int restrictpass = 1; - shellWalker shellWalk = *((shellWalker *)BMW_current_state(walker)); + BMwShellWalker shellWalk = *((BMwShellWalker *)BMW_current_state(walker)); if (!BLI_ghash_haskey(walker->visithash, shellWalk.base)) { BLI_ghash_insert(walker->visithash, shellWalk.base, NULL); @@ -140,7 +140,7 @@ static void *shellWalker_step(BMWalker *walker) if (!walker->restrictflag || (walker->restrictflag && BMO_elem_flag_test(walker->bm, curedge, walker->restrictflag))) { - shellWalker *newstate; + BMwShellWalker *newstate; ov = BM_edge_other_vert(curedge, shellWalk.base); @@ -166,9 +166,9 @@ static void *shellWalker_step(BMWalker *walker) * * Similar to shell walker, but visits vertices instead of edges. */ -static void connectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v) +static void bmw_ConnectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v) { - connectedVertexWalker *vwalk; + BMwConnectedVertexWalker *vwalk; if (BLI_ghash_haskey(walker->visithash, v)) { /* already visited */ @@ -184,21 +184,21 @@ static void connectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v) BLI_ghash_insert(walker->visithash, v, NULL); } -static void connectedVertexWalker_begin(BMWalker *walker, void *data) +static void bmw_ConnectedVertexWalker_begin(BMWalker *walker, void *data) { BMVert *v = data; - connectedVertexWalker_visitVertex(walker, v); + bmw_ConnectedVertexWalker_visitVertex(walker, v); } -static void *connectedVertexWalker_yield(BMWalker *walker) +static void *bmw_ConnectedVertexWalker_yield(BMWalker *walker) { - connectedVertexWalker *vwalk = BMW_current_state(walker); + BMwConnectedVertexWalker *vwalk = BMW_current_state(walker); return vwalk->curvert; } -static void *connectedVertexWalker_step(BMWalker *walker) +static void *bmw_ConnectedVertexWalker_step(BMWalker *walker) { - connectedVertexWalker *vwalk = BMW_current_state(walker); + BMwConnectedVertexWalker *vwalk = BMW_current_state(walker); BMVert *v, *v2; BMEdge *e; BMIter iter; @@ -210,7 +210,7 @@ static void *connectedVertexWalker_step(BMWalker *walker) BM_ITER(e, &iter, walker->bm, BM_EDGES_OF_VERT, v) { v2 = BM_edge_other_vert(e, v); if (!BLI_ghash_haskey(walker->visithash, v2)) { - connectedVertexWalker_visitVertex(walker, v2); + bmw_ConnectedVertexWalker_visitVertex(walker, v2); } } @@ -224,10 +224,10 @@ static void *connectedVertexWalker_step(BMWalker *walker) * * \todo Add restriction flag/callback for wire edges. */ -static void islandboundWalker_begin(BMWalker *walker, void *data) +static void bmw_IslandboundWalker_begin(BMWalker *walker, void *data) { BMLoop *l = data; - islandboundWalker *iwalk = NULL; + BMwIslandboundWalker *iwalk = NULL; iwalk = BMW_state_add(walker); @@ -238,16 +238,16 @@ static void islandboundWalker_begin(BMWalker *walker, void *data) } -static void *islandboundWalker_yield(BMWalker *walker) +static void *bmw_IslandboundWalker_yield(BMWalker *walker) { - islandboundWalker *iwalk = BMW_current_state(walker); + BMwIslandboundWalker *iwalk = BMW_current_state(walker); return iwalk->curloop; } -static void *islandboundWalker_step(BMWalker *walker) +static void *bmw_IslandboundWalker_step(BMWalker *walker) { - islandboundWalker *iwalk = BMW_current_state(walker), owalk; + BMwIslandboundWalker *iwalk = BMW_current_state(walker), owalk; BMVert *v; BMEdge *e = iwalk->curloop->e; BMFace *f; @@ -274,8 +274,8 @@ static void *islandboundWalker_step(BMWalker *walker) while (1) { l = BM_face_other_loop(e, f, v); - if (bmesh_radial_loop_next(l) != l) { - l = bmesh_radial_loop_next(l); + if (l != l->radial_next) { + l = l->radial_next; f = l->f; e = l->e; if (walker->mask_face && !BMO_elem_flag_test(walker->bm, f, walker->mask_face)) { @@ -317,9 +317,9 @@ static void *islandboundWalker_step(BMWalker *walker) * * \todo Add restriction flag/callback for wire edges. */ -static void islandWalker_begin(BMWalker *walker, void *data) +static void bmw_IslandWalker_begin(BMWalker *walker, void *data) { - islandWalker *iwalk = NULL; + BMwIslandWalker *iwalk = NULL; if (walker->mask_face && !BMO_elem_flag_test(walker->bm, (BMElemF *)data, walker->mask_face)) { return; @@ -331,17 +331,17 @@ static void islandWalker_begin(BMWalker *walker, void *data) iwalk->cur = data; } -static void *islandWalker_yield(BMWalker *walker) +static void *bmw_IslandWalker_yield(BMWalker *walker) { - islandWalker *iwalk = BMW_current_state(walker); + BMwIslandWalker *iwalk = BMW_current_state(walker); return iwalk->cur; } -static void *islandWalker_step(BMWalker *walker) +static void *bmw_IslandWalker_step(BMWalker *walker) { - islandWalker *iwalk = BMW_current_state(walker); - /* islandWalker *owalk = iwalk; */ /* UNUSED */ + BMwIslandWalker *iwalk = BMW_current_state(walker); + /* BMwIslandWalker *owalk = iwalk; */ /* UNUSED */ BMIter iter, liter; BMFace *f, *curf = iwalk->cur; BMLoop *l; @@ -360,7 +360,10 @@ static void *islandWalker_step(BMWalker *walker) if (walker->mask_face && !BMO_elem_flag_test(walker->bm, f, walker->mask_face)) { continue; } - if (BLI_ghash_haskey(walker->visithash, f)) continue; + + if (BLI_ghash_haskey(walker->visithash, f)) { + continue; + } iwalk = BMW_state_add(walker); iwalk->cur = f; @@ -378,9 +381,9 @@ static void *islandWalker_step(BMWalker *walker) * * Starts at a tool-flagged edge and walks over the edge loop */ -static void loopWalker_begin(BMWalker *walker, void *data) +static void bmw_LoopWalker_begin(BMWalker *walker, void *data) { - loopWalker *lwalk = NULL, owalk; + BMwLoopWalker *lwalk = NULL, owalk; BMEdge *e = data; BMVert *v; /* int found = 1, val; */ /* UNUSED */ @@ -399,7 +402,7 @@ static void loopWalker_begin(BMWalker *walker, void *data) /* rewin */ while (BMW_current_state(walker)) { - owalk = *((loopWalker *)BMW_current_state(walker)); + owalk = *((BMwLoopWalker *)BMW_current_state(walker)); BMW_walk(walker); } @@ -416,16 +419,16 @@ static void loopWalker_begin(BMWalker *walker, void *data) BLI_ghash_insert(walker->visithash, owalk.cur, NULL); } -static void *loopWalker_yield(BMWalker *walker) +static void *bmw_LoopWalker_yield(BMWalker *walker) { - loopWalker *lwalk = BMW_current_state(walker); + BMwLoopWalker *lwalk = BMW_current_state(walker); return lwalk->cur; } -static void *loopWalker_step(BMWalker *walker) +static void *bmw_LoopWalker_step(BMWalker *walker) { - loopWalker *lwalk = BMW_current_state(walker), owalk; + BMwLoopWalker *lwalk = BMW_current_state(walker), owalk; BMIter eiter; BMEdge *e = lwalk->cur, *nexte = NULL; BMLoop *l, *l2; @@ -476,7 +479,7 @@ static void *loopWalker_step(BMWalker *walker) if (!l) break; - l2 = bmesh_radial_loop_next(l); + l2 = l->radial_next; if (l2 == l) { break; @@ -514,7 +517,7 @@ static void *loopWalker_step(BMWalker *walker) /* Check whether the face loop should includes the face specified * by the given BMLoop */ -static int faceloopWalker_include_face(BMWalker *walker, BMLoop *l) +static int bmw_FaceLoopWalker_include_face(BMWalker *walker, BMLoop *l) { /* face must have degree 4 */ if (l->f->len != 4) { @@ -530,7 +533,7 @@ static int faceloopWalker_include_face(BMWalker *walker, BMLoop *l) } /* Check whether the face loop can start from the given edge */ -static int faceloopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e) +static int bmw_FaceLoopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e) { BMesh *bm = walker->bm; @@ -542,7 +545,7 @@ static int faceloopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e) /* Don't start a loop from a boundary edge if it cannot * be extended to cover any faces */ if (BM_edge_face_count(e) == 1) { - if (!faceloopWalker_include_face(walker, e->l)) { + if (!bmw_FaceLoopWalker_include_face(walker, e->l)) { return FALSE; } } @@ -555,14 +558,14 @@ static int faceloopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e) return TRUE; } -static void faceloopWalker_begin(BMWalker *walker, void *data) +static void bmw_FaceLoopWalker_begin(BMWalker *walker, void *data) { - faceloopWalker *lwalk, owalk; + BMwFaceLoopWalker *lwalk, owalk; BMEdge *e = data; /* BMesh *bm = walker->bm; */ /* UNUSED */ /* int fcount = BM_edge_face_count(e); */ /* UNUSED */ - if (!faceloopWalker_edge_begins_loop(walker, e)) + if (!bmw_FaceLoopWalker_edge_begins_loop(walker, e)) return; lwalk = BMW_state_add(walker); @@ -572,7 +575,7 @@ static void faceloopWalker_begin(BMWalker *walker, void *data) /* rewin */ while (BMW_current_state(walker)) { - owalk = *((faceloopWalker *)BMW_current_state(walker)); + owalk = *((BMwFaceLoopWalker *)BMW_current_state(walker)); BMW_walk(walker); } @@ -585,9 +588,9 @@ static void faceloopWalker_begin(BMWalker *walker, void *data) BLI_ghash_insert(walker->visithash, lwalk->l->f, NULL); } -static void *faceloopWalker_yield(BMWalker *walker) +static void *bmw_FaceLoopWalker_yield(BMWalker *walker) { - faceloopWalker *lwalk = BMW_current_state(walker); + BMwFaceLoopWalker *lwalk = BMW_current_state(walker); if (!lwalk) { return NULL; @@ -596,9 +599,9 @@ static void *faceloopWalker_yield(BMWalker *walker) return lwalk->l->f; } -static void *faceloopWalker_step(BMWalker *walker) +static void *bmw_FaceLoopWalker_step(BMWalker *walker) { - faceloopWalker *lwalk = BMW_current_state(walker); + BMwFaceLoopWalker *lwalk = BMW_current_state(walker); BMFace *f = lwalk->l->f; BMLoop *l = lwalk->l, *origl = lwalk->l; @@ -609,7 +612,7 @@ static void *faceloopWalker_step(BMWalker *walker) if (lwalk->nocalc) return f; - if (!faceloopWalker_include_face(walker, l)) { + if (!bmw_FaceLoopWalker_include_face(walker, l)) { l = lwalk->l; l = l->next->next; if (BM_edge_face_count(l->e) != 2) { @@ -618,7 +621,7 @@ static void *faceloopWalker_step(BMWalker *walker) l = l->radial_next; } - if (faceloopWalker_include_face(walker, l)) { + if (bmw_FaceLoopWalker_include_face(walker, l)) { lwalk = BMW_state_add(walker); lwalk->l = l; @@ -643,9 +646,9 @@ static void *faceloopWalker_step(BMWalker *walker) * Conditions for starting and stepping the edge ring have been * tuned in an attempt to match the edge rings built by EditMesh */ -static void edgeringWalker_begin(BMWalker *walker, void *data) +static void bmw_EdgeringWalker_begin(BMWalker *walker, void *data) { - edgeringWalker *lwalk, owalk; + BMwEdgeringWalker *lwalk, owalk; BMEdge *e = data; lwalk = BMW_state_add(walker); @@ -663,7 +666,7 @@ static void edgeringWalker_begin(BMWalker *walker, void *data) /* rewin */ while (BMW_current_state(walker)) { - owalk = *((edgeringWalker *)BMW_current_state(walker)); + owalk = *((BMwEdgeringWalker *)BMW_current_state(walker)); BMW_walk(walker); } @@ -678,9 +681,9 @@ static void edgeringWalker_begin(BMWalker *walker, void *data) BLI_ghash_insert(walker->visithash, lwalk->l->e, NULL); } -static void *edgeringWalker_yield(BMWalker *walker) +static void *bmw_EdgeringWalker_yield(BMWalker *walker) { - edgeringWalker *lwalk = BMW_current_state(walker); + BMwEdgeringWalker *lwalk = BMW_current_state(walker); if (!lwalk) { return NULL; @@ -692,9 +695,9 @@ static void *edgeringWalker_yield(BMWalker *walker) return lwalk->wireedge; } -static void *edgeringWalker_step(BMWalker *walker) +static void *bmw_EdgeringWalker_step(BMWalker *walker) { - edgeringWalker *lwalk = BMW_current_state(walker); + BMwEdgeringWalker *lwalk = BMW_current_state(walker); BMEdge *e; BMLoop *l = lwalk->l /* , *origl = lwalk->l */; BMesh *bm = walker->bm; @@ -745,9 +748,9 @@ static void *edgeringWalker_step(BMWalker *walker) return e; } -static void uvedgeWalker_begin(BMWalker *walker, void *data) +static void bmw_UVEdgeWalker_begin(BMWalker *walker, void *data) { - uvedgeWalker *lwalk; + BMwUVEdgeWalker *lwalk; BMLoop *l = data; if (BLI_ghash_haskey(walker->visithash, l)) @@ -758,9 +761,9 @@ static void uvedgeWalker_begin(BMWalker *walker, void *data) BLI_ghash_insert(walker->visithash, l, NULL); } -static void *uvedgeWalker_yield(BMWalker *walker) +static void *bmw_UVEdgeWalker_yield(BMWalker *walker) { - uvedgeWalker *lwalk = BMW_current_state(walker); + BMwUVEdgeWalker *lwalk = BMW_current_state(walker); if (!lwalk) { return NULL; @@ -769,9 +772,9 @@ static void *uvedgeWalker_yield(BMWalker *walker) return lwalk->l; } -static void *uvedgeWalker_step(BMWalker *walker) +static void *bmw_UVEdgeWalker_step(BMWalker *walker) { - uvedgeWalker *lwalk = BMW_current_state(walker); + BMwUVEdgeWalker *lwalk = BMW_current_state(walker); BMLoop *l, *l2, *l3, *nl, *cl; BMIter liter; void *d1, *d2; @@ -787,7 +790,7 @@ static void *uvedgeWalker_step(BMWalker *walker) return l; /* go over loops around l->v and nl->v and see which ones share l and nl's - * mloopuv's coordinates. in addition, push on l->next if necassary */ + * mloopuv's coordinates. in addition, push on l->next if necessary */ for (i = 0; i < 2; i++) { cl = i ? nl : l; BM_ITER(l2, &liter, walker->bm, BM_LOOPS_OF_VERT, cl->v) { @@ -823,87 +826,87 @@ static void *uvedgeWalker_step(BMWalker *walker) return l; } -static BMWalker shell_walker_type = { - shellWalker_begin, - shellWalker_step, - shellWalker_yield, - sizeof(shellWalker), +static BMWalker bmw_ShellWalker_Type = { + bmw_ShellWalker_begin, + bmw_ShellWalker_step, + bmw_ShellWalker_yield, + sizeof(BMwShellWalker), BMW_BREADTH_FIRST, BM_EDGE, /* valid restrict masks */ }; -static BMWalker islandbound_walker_type = { - islandboundWalker_begin, - islandboundWalker_step, - islandboundWalker_yield, - sizeof(islandboundWalker), +static BMWalker bmw_IslandboundWalker_Type = { + bmw_IslandboundWalker_begin, + bmw_IslandboundWalker_step, + bmw_IslandboundWalker_yield, + sizeof(BMwIslandboundWalker), BMW_DEPTH_FIRST, BM_FACE, /* valid restrict masks */ }; -static BMWalker island_walker_type = { - islandWalker_begin, - islandWalker_step, - islandWalker_yield, - sizeof(islandWalker), +static BMWalker bmw_IslandWalker_Type = { + bmw_IslandWalker_begin, + bmw_IslandWalker_step, + bmw_IslandWalker_yield, + sizeof(BMwIslandWalker), BMW_BREADTH_FIRST, BM_EDGE | BM_FACE, /* valid restrict masks */ }; -static BMWalker loop_walker_type = { - loopWalker_begin, - loopWalker_step, - loopWalker_yield, - sizeof(loopWalker), +static BMWalker bmw_LoopWalker_Type = { + bmw_LoopWalker_begin, + bmw_LoopWalker_step, + bmw_LoopWalker_yield, + sizeof(BMwLoopWalker), BMW_DEPTH_FIRST, 0, /* valid restrict masks */ /* could add flags here but so far none are used */ }; -static BMWalker faceloop_walker_type = { - faceloopWalker_begin, - faceloopWalker_step, - faceloopWalker_yield, - sizeof(faceloopWalker), +static BMWalker bmw_FaceLoopWalker_Type = { + bmw_FaceLoopWalker_begin, + bmw_FaceLoopWalker_step, + bmw_FaceLoopWalker_yield, + sizeof(BMwFaceLoopWalker), BMW_DEPTH_FIRST, 0, /* valid restrict masks */ /* could add flags here but so far none are used */ }; -static BMWalker edgering_walker_type = { - edgeringWalker_begin, - edgeringWalker_step, - edgeringWalker_yield, - sizeof(edgeringWalker), +static BMWalker bmw_EdgeringWalker_Type = { + bmw_EdgeringWalker_begin, + bmw_EdgeringWalker_step, + bmw_EdgeringWalker_yield, + sizeof(BMwEdgeringWalker), BMW_DEPTH_FIRST, 0, /* valid restrict masks */ /* could add flags here but so far none are used */ }; -static BMWalker loopdata_region_walker_type = { - uvedgeWalker_begin, - uvedgeWalker_step, - uvedgeWalker_yield, - sizeof(uvedgeWalker), +static BMWalker bmw_UVEdgeWalker_Type = { + bmw_UVEdgeWalker_begin, + bmw_UVEdgeWalker_step, + bmw_UVEdgeWalker_yield, + sizeof(BMwUVEdgeWalker), BMW_DEPTH_FIRST, BM_EDGE, /* valid restrict masks */ }; -static BMWalker connected_vertex_walker_type = { - connectedVertexWalker_begin, - connectedVertexWalker_step, - connectedVertexWalker_yield, - sizeof(connectedVertexWalker), +static BMWalker bmw_ConnectedVertexWalker_Type = { + bmw_ConnectedVertexWalker_begin, + bmw_ConnectedVertexWalker_step, + bmw_ConnectedVertexWalker_yield, + sizeof(BMwConnectedVertexWalker), BMW_BREADTH_FIRST, BM_VERT, /* valid restrict masks */ }; BMWalker *bm_walker_types[] = { - &shell_walker_type, /* BMW_SHELL */ - &loop_walker_type, /* BMW_LOOP */ - &faceloop_walker_type, /* BMW_FACELOOP */ - &edgering_walker_type, /* BMW_EDGERING */ - &loopdata_region_walker_type, /* BMW_LOOPDATA_ISLAND */ - &islandbound_walker_type, /* BMW_ISLANDBOUND */ - &island_walker_type, /* BMW_ISLAND */ - &connected_vertex_walker_type, /* BMW_CONNECTED_VERTEX */ + &bmw_ShellWalker_Type, /* BMW_SHELL */ + &bmw_LoopWalker_Type, /* BMW_LOOP */ + &bmw_FaceLoopWalker_Type, /* BMW_FACELOOP */ + &bmw_EdgeringWalker_Type, /* BMW_EDGERING */ + &bmw_UVEdgeWalker_Type, /* BMW_LOOPDATA_ISLAND */ + &bmw_IslandboundWalker_Type, /* BMW_ISLANDBOUND */ + &bmw_IslandWalker_Type, /* BMW_ISLAND */ + &bmw_ConnectedVertexWalker_Type, /* BMW_CONNECTED_VERTEX */ }; -int bm_totwalkers = sizeof(bm_walker_types) / sizeof(*bm_walker_types); +const int bm_totwalkers = sizeof(bm_walker_types) / sizeof(*bm_walker_types); diff --git a/source/blender/bmesh/intern/bmesh_walkers_private.h b/source/blender/bmesh/intern/bmesh_walkers_private.h index 963018856ad..b1447b52d1a 100644 --- a/source/blender/bmesh/intern/bmesh_walkers_private.h +++ b/source/blender/bmesh/intern/bmesh_walkers_private.h @@ -30,60 +30,60 @@ */ extern BMWalker *bm_walker_types[]; -extern int bm_totwalkers; +extern const int bm_totwalkers; -/* Pointer hiding*/ -typedef struct bmesh_walkerGeneric { +/* Pointer hiding */ +typedef struct BMwGenericWalker { Link link; int depth; -} bmesh_walkerGeneric; +} BMwGenericWalker; -typedef struct shellWalker { - bmesh_walkerGeneric header; +typedef struct BMwShellWalker { + BMwGenericWalker header; BMEdge *curedge; -} shellWalker; +} BMwShellWalker; -typedef struct islandboundWalker { - bmesh_walkerGeneric header; +typedef struct BMwIslandboundWalker { + BMwGenericWalker header; BMLoop *base; BMVert *lastv; BMLoop *curloop; -} islandboundWalker; +} BMwIslandboundWalker; -typedef struct islandWalker { - bmesh_walkerGeneric header; +typedef struct BMwIslandWalker { + BMwGenericWalker header; BMFace *cur; -} islandWalker; +} BMwIslandWalker; -typedef struct loopWalker { - bmesh_walkerGeneric header; +typedef struct BMwLoopWalker { + BMwGenericWalker header; BMEdge *cur, *start; BMVert *lastv, *startv; int startrad, stage2; -} loopWalker; +} BMwLoopWalker; -typedef struct faceloopWalker { - bmesh_walkerGeneric header; +typedef struct BMwFaceLoopWalker { + BMwGenericWalker header; BMLoop *l; int nocalc; -} faceloopWalker; +} BMwFaceLoopWalker; -typedef struct edgeringWalker { - bmesh_walkerGeneric header; +typedef struct BMwEdgeringWalker { + BMwGenericWalker header; BMLoop *l; BMEdge *wireedge; -} edgeringWalker; +} BMwEdgeringWalker; -typedef struct uvedgeWalker { - bmesh_walkerGeneric header; +typedef struct BMwUVEdgeWalker { + BMwGenericWalker header; BMLoop *l; -} uvedgeWalker; +} BMwUVEdgeWalker; -typedef struct connectedVertexWalker { - bmesh_walkerGeneric header; +typedef struct BMwConnectedVertexWalker { + BMwGenericWalker header; BMVert *curvert; -} connectedVertexWalker; +} BMwConnectedVertexWalker; #endif /* __BMESH_WALKERS_PRIVATE_H__ */ diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index 6cdea3657f6..e6262f52282 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -876,6 +876,6 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BLI_array_free(edges); BLI_array_free(faces); - BMO_slot_from_flag(bm, op, "face_spans", FACE_SPAN, BM_FACE); - BMO_slot_from_flag(bm, op, "face_holes", FACE_HOLE, BM_FACE); + BMO_slot_buffer_from_flag(bm, op, "face_spans", FACE_SPAN, BM_FACE); + BMO_slot_buffer_from_flag(bm, op, "face_holes", FACE_HOLE, BM_FACE); } diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c index d2d4eaf8129..03f10cc8814 100644 --- a/source/blender/bmesh/operators/bmo_connect.c +++ b/source/blender/bmesh/operators/bmo_connect.c @@ -51,7 +51,9 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op) BLI_array_empty(loops); BLI_array_empty(verts); - if (BMO_elem_flag_test(bm, f, FACE_NEW)) continue; + if (BMO_elem_flag_test(bm, f, FACE_NEW)) { + continue; + } l = BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, f); lastl = NULL; @@ -74,7 +76,9 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op) } } - if (BLI_array_count(loops) == 0) continue; + if (BLI_array_count(loops) == 0) { + continue; + } if (BLI_array_count(loops) > 2) { BLI_array_growone(loops); @@ -87,7 +91,9 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op) BM_face_legal_splits(bm, f, (BMLoop *(*)[2])loops, BLI_array_count(loops) / 2); for (i = 0; i < BLI_array_count(loops) / 2; i++) { - if (loops[i * 2] == NULL) continue; + if (loops[i * 2] == NULL) { + continue; + } BLI_array_growone(verts); verts[BLI_array_count(verts) - 1] = loops[i * 2]->v; @@ -110,7 +116,7 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_from_flag(bm, op, "edgeout", EDGE_OUT, BM_EDGE); + BMO_slot_buffer_from_flag(bm, op, "edgeout", EDGE_OUT, BM_EDGE); BLI_array_free(loops); BLI_array_free(verts); diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c index 8798155845e..67e4f09463d 100644 --- a/source/blender/bmesh/operators/bmo_create.c +++ b/source/blender/bmesh/operators/bmo_create.c @@ -621,8 +621,8 @@ static PathBase *edge_pathbase_new(void) { PathBase *pb = MEM_callocN(sizeof(PathBase), "PathBase"); - pb->nodepool = BLI_mempool_create(sizeof(EPathNode), 1, 512, TRUE, FALSE); - pb->pathpool = BLI_mempool_create(sizeof(EPath), 1, 512, TRUE, FALSE); + pb->nodepool = BLI_mempool_create(sizeof(EPathNode), 1, 512, BLI_MEMPOOL_SYSMALLOC); + pb->pathpool = BLI_mempool_create(sizeof(EPath), 1, 512, BLI_MEMPOOL_SYSMALLOC); return pb; } @@ -1035,7 +1035,7 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op) edge_free_path(pathbase, path); } - BMO_slot_from_flag(bm, op, "faceout", FACE_NEW, BM_FACE); + BMO_slot_buffer_from_flag(bm, op, "faceout", FACE_NEW, BM_FACE); BLI_array_free(edges); BLI_array_free(verts); @@ -1232,7 +1232,7 @@ void bmo_edgenet_prepare(BMesh *bm, BMOperator *op) } } - BMO_slot_from_flag(bm, op, "edgeout", ELE_NEW, BM_EDGE); + BMO_slot_buffer_from_flag(bm, op, "edgeout", ELE_NEW, BM_EDGE); BLI_array_free(edges1); BLI_array_free(edges2); @@ -1340,7 +1340,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) BMO_op_exec(bm, &op2); /* return if edge net create did somethin */ - if (BMO_slot_buf_count(bm, &op2, "faceout")) { + if (BMO_slot_buffer_count(bm, &op2, "faceout")) { BMO_slot_copy(&op2, op, "faceout", "faceout"); BMO_op_finish(bm, &op2); return; @@ -1353,7 +1353,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) BMO_op_exec(bm, &op2); /* if we dissolved anything, then return */ - if (BMO_slot_buf_count(bm, &op2, "regionout")) { + if (BMO_slot_buffer_count(bm, &op2, "regionout")) { BMO_slot_copy(&op2, op, "regionout", "faceout"); BMO_op_finish(bm, &op2); return; diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c index 4542b3fd917..9e07cb177dd 100644 --- a/source/blender/bmesh/operators/bmo_dissolve.c +++ b/source/blender/bmesh/operators/bmo_dissolve.c @@ -53,7 +53,7 @@ static int UNUSED_FUNCTION(check_hole_in_region)(BMesh *bm, BMFace *f) for ( ; f2; f2 = BMW_step(®walker)) { l2 = BM_iter_new(&liter2, bm, BM_LOOPS_OF_FACE, f2); for ( ; l2; l2 = BM_iter_step(&liter2)) { - l3 = bmesh_radial_loop_next(l2); + l3 = l2->radial_next; if ( BMO_elem_flag_test(bm, l3->f, FACE_MARK) != BMO_elem_flag_test(bm, l2->f, FACE_MARK)) { @@ -96,7 +96,10 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) /* collect region */ BMO_ITER(f, &oiter, bm, op, "faces", BM_FACE) { - if (!BMO_elem_flag_test(bm, f, FACE_MARK)) continue; + + if (!BMO_elem_flag_test(bm, f, FACE_MARK)) { + continue; + } BLI_array_empty(faces); faces = NULL; /* forces different allocatio */ @@ -171,12 +174,14 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) } } - if (BMO_error_occurred(bm)) goto cleanup; + if (BMO_error_occurred(bm)) { + goto cleanup; + } - BMO_slot_from_flag(bm, op, "regionout", FACE_NEW, BM_FACE); + BMO_slot_buffer_from_flag(bm, op, "regionout", FACE_NEW, BM_FACE); cleanup: - /* free/cleanu */ + /* free/cleanup */ for (i = 0; i < BLI_array_count(regions); i++) { if (regions[i]) MEM_freeN(regions[i]); } @@ -319,13 +324,11 @@ static int test_extra_verts(BMesh *bm, BMVert *v) } void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op) { - BMOpSlot *vinput; BMIter iter, fiter; BMVert *v; BMFace *f; /* int i; */ - - vinput = BMO_slot_get(op, "verts"); + BMO_slot_buffer_flag_enable(bm, op, "verts", VERT_MARK, BM_VERT); for (v = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); v; v = BM_iter_step(&iter)) { @@ -463,14 +466,14 @@ void dummy_exec(BMesh *bm, BMOperator *op) #endif /**/ -typedef struct DissolveElemWeight_t { +typedef struct DissolveElemWeight { BMHeader *ele; float weight; -} DissolveElemWeight_t; +} DissolveElemWeight; static int dissolve_elem_cmp(const void *a1, const void *a2) { - const struct DissolveElemWeight_t *d1 = a1, *d2 = a2; + const struct DissolveElemWeight *d1 = a1, *d2 = a2; if (d1->weight > d2->weight) return 1; else if (d1->weight < d2->weight) return -1; @@ -483,8 +486,8 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op) BMOpSlot *vinput = BMO_slot_get(op, "verts"); const float angle_max = (float)M_PI / 2.0f; const float angle_limit = minf(angle_max, BMO_slot_float_get(op, "angle_limit")); - DissolveElemWeight_t *weight_elems = MEM_mallocN(MAX2(einput->len, vinput->len) * - sizeof(DissolveElemWeight_t), __func__); + DissolveElemWeight *weight_elems = MEM_mallocN(MAX2(einput->len, vinput->len) * + sizeof(DissolveElemWeight), __func__); int i, tot_found; /* --- first edges --- */ @@ -506,7 +509,7 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op) } if (tot_found != 0) { - qsort(weight_elems, einput->len, sizeof(DissolveElemWeight_t), dissolve_elem_cmp); + qsort(weight_elems, einput->len, sizeof(DissolveElemWeight), dissolve_elem_cmp); for (i = 0; i < tot_found; i++) { BMEdge *e = (BMEdge *)weight_elems[i].ele; @@ -541,7 +544,7 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op) } if (tot_found != 0) { - qsort(weight_elems, vinput->len, sizeof(DissolveElemWeight_t), dissolve_elem_cmp); + qsort(weight_elems, vinput->len, sizeof(DissolveElemWeight), dissolve_elem_cmp); for (i = 0; i < tot_found; i++) { BMVert *v = (BMVert *)weight_elems[i].ele; diff --git a/source/blender/bmesh/operators/bmo_dupe.c b/source/blender/bmesh/operators/bmo_dupe.c index 20f1920c07f..5c800ba083a 100644 --- a/source/blender/bmesh/operators/bmo_dupe.c +++ b/source/blender/bmesh/operators/bmo_dupe.c @@ -335,7 +335,7 @@ void bmo_dupe_exec(BMesh *bm, BMOperator *op) BMO_slot_copy(dupeop, dupeop, "geom", "origout"); /* Now alloc the new output buffer */ - BMO_slot_from_flag(bm, dupeop, "newout", DUPE_NEW, BM_ALL); + BMO_slot_buffer_from_flag(bm, dupeop, "newout", DUPE_NEW, BM_ALL); } #if 0 /* UNUSED */ @@ -348,7 +348,7 @@ void BMO_dupe_from_flag(BMesh *bm, int etypeflag, const char hflag) BMOperator dupeop; BMO_op_init(bm, &dupeop, "dupe"); - BMO_slot_from_hflag(bm, &dupeop, "geom", hflag, etypeflag); + BMO_slot_buffer_from_hflag(bm, &dupeop, "geom", hflag, etypeflag); BMO_op_exec(bm, &dupeop); BMO_op_finish(bm, &dupeop); @@ -429,7 +429,7 @@ void bmo_split_exec(BMesh *bm, BMOperator *op) /* connect outputs of dupe to delete, exluding keep geometr */ BMO_slot_int_set(&delop, "context", DEL_FACES); - BMO_slot_from_flag(bm, &delop, "geom", SPLIT_INPUT, BM_ALL); + BMO_slot_buffer_from_flag(bm, &delop, "geom", SPLIT_INPUT, BM_ALL); BMO_op_exec(bm, &delop); @@ -440,7 +440,7 @@ void bmo_split_exec(BMesh *bm, BMOperator *op) BMO_slot_copy(&dupeop, splitop, "isovertmap", "isovertmap"); - /* cleanu */ + /* cleanup */ BMO_op_finish(bm, &delop); BMO_op_finish(bm, &dupeop); } diff --git a/source/blender/bmesh/operators/bmo_edgesplit.c b/source/blender/bmesh/operators/bmo_edgesplit.c index 59d0c1f1e1b..059ee882fb8 100644 --- a/source/blender/bmesh/operators/bmo_edgesplit.c +++ b/source/blender/bmesh/operators/bmo_edgesplit.c @@ -20,6 +20,8 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include <string.h> /* for memcpy */ + #include "MEM_guardedalloc.h" #include "BLI_array.h" @@ -298,7 +300,7 @@ void bmo_edgesplit_exec(BMesh *bm, BMOperator *op) } else { /* generate unique vert for non-seam edge(s) - * around the manifold vert fan if necassary */ + * around the manifold vert fan if necessary */ /* first check that we have two seam edges * somewhere within this fa */ @@ -414,8 +416,8 @@ void bmo_edgesplit_exec(BMesh *bm, BMOperator *op) #endif tag_out_edges(bm, etags, op); - BMO_slot_from_flag(bm, op, "edgeout1", EDGE_RET1, BM_EDGE); - BMO_slot_from_flag(bm, op, "edgeout2", EDGE_RET2, BM_EDGE); + BMO_slot_buffer_from_flag(bm, op, "edgeout1", EDGE_RET1, BM_EDGE); + BMO_slot_buffer_from_flag(bm, op, "edgeout2", EDGE_RET2, BM_EDGE); BLI_array_free(verts); BLI_array_free(edges_tmp); diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c index 7425d20bd88..ab5287a3d89 100644 --- a/source/blender/bmesh/operators/bmo_extrude.c +++ b/source/blender/bmesh/operators/bmo_extrude.c @@ -29,9 +29,11 @@ #include "bmesh_operators_private.h" /* own include */ -#define EXT_INPUT 1 -#define EXT_KEEP 2 -#define EXT_DEL 4 +enum { + EXT_INPUT = 1, + EXT_KEEP = 2, + EXT_DEL = 4 +}; #define VERT_MARK 1 #define EDGE_MARK 1 @@ -108,7 +110,7 @@ void bmo_extrude_face_indiv_exec(BMesh *bm, BMOperator *op) BLI_array_free(edges); BMO_op_callf(bm, "del geom=%ff context=%i", EXT_DEL, DEL_ONLYFACES); - BMO_slot_from_flag(bm, op, "faceout", EXT_KEEP, BM_FACE); + BMO_slot_buffer_from_flag(bm, op, "faceout", EXT_KEEP, BM_FACE); } void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op) @@ -160,7 +162,7 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op) BMO_op_finish(bm, &dupeop); - BMO_slot_from_flag(bm, op, "geomout", EXT_KEEP, BM_ALL); + BMO_slot_buffer_from_flag(bm, op, "geomout", EXT_KEEP, BM_ALL); } void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op) @@ -179,8 +181,8 @@ void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op) BMO_elem_flag_enable(bm, dupev, EXT_KEEP); } - BMO_slot_from_flag(bm, op, "vertout", EXT_KEEP, BM_VERT); - BMO_slot_from_flag(bm, op, "edgeout", EXT_KEEP, BM_EDGE); + BMO_slot_buffer_from_flag(bm, op, "vertout", EXT_KEEP, BM_VERT); + BMO_slot_buffer_from_flag(bm, op, "edgeout", EXT_KEEP, BM_EDGE); } void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) @@ -192,7 +194,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) BMLoop *l, *l2; BMVert *verts[4], *v, *v2; BMFace *f; - int rlen, found, fwd, delorig = 0; + int found, fwd, delorig = FALSE; /* initialize our sub-operators */ BMO_op_init(bm, &dupeop, "dupe"); @@ -203,19 +205,28 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) * original geometry unless caller explicitly asked to keep it. */ if (!BMO_slot_bool_get(op, "alwayskeeporig")) { BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { - if (!BMO_elem_flag_test(bm, e, EXT_INPUT)) continue; - found = 0; - f = BM_iter_new(&fiter, bm, BM_FACES_OF_EDGE, e); - for (rlen = 0; f; f = BM_iter_step(&fiter), rlen++) { + int edge_face_tot; + + if (!BMO_elem_flag_test(bm, e, EXT_INPUT)) { + continue; + } + + found = FALSE; /* found a face that isn't input? */ + edge_face_tot = 0; /* edge/face count */ + + BM_ITER(f, &fiter, bm, BM_FACES_OF_EDGE, e) { if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) { - found = 1; - delorig = 1; + found = TRUE; + delorig = TRUE; break; } + + edge_face_tot++; } - if (!found && (rlen > 1)) { + if ((edge_face_tot > 1) && (found == FALSE)) { + /* edge has a face user, that face isnt extrude input */ BMO_elem_flag_enable(bm, e, EXT_DEL); } } @@ -223,23 +234,26 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) /* calculate verts to delet */ BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) { - found = 0; + found = FALSE; BM_ITER(e, &viter, bm, BM_EDGES_OF_VERT, v) { if (!BMO_elem_flag_test(bm, e, EXT_INPUT) || !BMO_elem_flag_test(bm, e, EXT_DEL)) { - found = 1; + found = TRUE; break; } } - - BM_ITER(f, &viter, bm, BM_FACES_OF_VERT, v) { - if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) { - found = 1; - break; + + /* avoid an extra loop */ + if (found == TRUE) { + BM_ITER(f, &viter, bm, BM_FACES_OF_VERT, v) { + if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) { + found = TRUE; + break; + } } } - if (!found) { + if (found == FALSE) { BMO_elem_flag_enable(bm, v, EXT_DEL); } } @@ -250,7 +264,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) } } - if (delorig) { + if (delorig == TRUE) { BMO_op_initf(bm, &delop, "del geom=%fvef context=%i", EXT_DEL, DEL_ONLYTAGGED); } @@ -261,11 +275,13 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) if (bm->act_face && BMO_elem_flag_test(bm, bm->act_face, EXT_INPUT)) bm->act_face = BMO_slot_map_ptr_get(bm, &dupeop, "facemap", bm->act_face); - if (delorig) BMO_op_exec(bm, &delop); + if (delorig) { + BMO_op_exec(bm, &delop); + } /* if not delorig, reverse loops of original face */ if (!delorig) { - for (f = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL); f; f = BM_iter_step(&iter)) { + BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) { if (BMO_elem_flag_test(bm, f, EXT_INPUT)) { BM_face_normal_flip(bm, f); } @@ -275,11 +291,21 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) BMO_slot_copy(&dupeop, op, "newout", "geomout"); e = BMO_iter_new(&siter, bm, &dupeop, "boundarymap", 0); for ( ; e; e = BMO_iter_step(&siter)) { - if (BMO_slot_map_contains(bm, op, "exclude", e)) continue; - newedge = BMO_iter_map_value(&siter); - newedge = *(BMEdge **)newedge; - if (!newedge) continue; + /* this should always be wire, so this is mainly a speedup to avoid map lookup */ + if (BM_edge_is_wire(bm, e) && BMO_slot_map_contains(bm, op, "exclude", e)) { + /* The original edge was excluded, + * this would result in a standalone wire edge - see [#30399] */ + BM_edge_kill(bm, e); + + continue; + } + + newedge = *(BMEdge **)BMO_iter_map_value(&siter); + + if (!newedge) { + continue; + } /* orient loop to give same normal as a loop of newedge * if it exists (will be an extruded face), @@ -309,7 +335,11 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) /* copy attribute */ l = BM_iter_new(&iter, bm, BM_LOOPS_OF_FACE, f); for ( ; l; l = BM_iter_step(&iter)) { - if (l->e != e && l->e != newedge) continue; + + if (l->e != e && l->e != newedge) { + continue; + } + l2 = l->radial_next; if (l2 == l) { @@ -349,7 +379,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) BM_edge_create(bm, v, v2, v->e, TRUE); } - /* cleanu */ + /* cleanup */ if (delorig) BMO_op_finish(bm, &delop); BMO_op_finish(bm, &dupeop); } diff --git a/source/blender/bmesh/operators/bmo_mesh_conv.c b/source/blender/bmesh/operators/bmo_mesh_conv.c index 0a5c3d0752e..63d8e3b65c3 100644 --- a/source/blender/bmesh/operators/bmo_mesh_conv.c +++ b/source/blender/bmesh/operators/bmo_mesh_conv.c @@ -137,10 +137,10 @@ void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) printf("shapekey <-> mesh mismatch!\n"); } - CustomData_bmesh_init_pool(&bm->vdata, bm_mesh_allocsize_default[0]); - CustomData_bmesh_init_pool(&bm->edata, bm_mesh_allocsize_default[1]); - CustomData_bmesh_init_pool(&bm->ldata, bm_mesh_allocsize_default[2]); - CustomData_bmesh_init_pool(&bm->pdata, bm_mesh_allocsize_default[3]); + CustomData_bmesh_init_pool(&bm->vdata, me->totvert, BM_VERT); + CustomData_bmesh_init_pool(&bm->edata, me->totedge, BM_EDGE); + CustomData_bmesh_init_pool(&bm->ldata, me->totloop, BM_LOOP); + CustomData_bmesh_init_pool(&bm->pdata, me->totpoly, BM_FACE); for (i = 0, mvert = me->mvert; i < me->totvert; i++, mvert++) { v = BM_vert_create(bm, keyco && set_key ? keyco[i] : mvert->co, NULL); @@ -150,7 +150,7 @@ void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) /* transfer flag */ v->head.hflag = BM_vert_flag_from_mflag(mvert->flag); - /* this is necassary for selection counts to work properl */ + /* this is necessary for selection counts to work properl */ if (BM_elem_flag_test(v, BM_ELEM_SELECT)) BM_vert_select_set(bm, v, TRUE); normal_short_to_float_v3(v->no, mvert->no); @@ -196,7 +196,7 @@ void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) /* transfer flags */ e->head.hflag = BM_edge_flag_from_mflag(medge->flag); - /* this is necassary for selection counts to work properly */ + /* this is necessary for selection counts to work properly */ if (BM_elem_flag_test(e, BM_ELEM_SELECT)) BM_elem_select_set(bm, e, TRUE); /* Copy Custom Dat */ @@ -260,7 +260,7 @@ void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) /* transfer flag */ f->head.hflag = BM_face_flag_from_mflag(mpoly->flag); - /* this is necassary for selection counts to work properl */ + /* this is necessary for selection counts to work properl */ if (BM_elem_flag_test(f, BM_ELEM_SELECT)) BM_elem_select_set(bm, f, TRUE); f->mat_nr = mpoly->mat_nr; @@ -370,7 +370,7 @@ void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op) /* Scene *scene = BMO_slot_ptr_get(op, "scene"); */ Mesh *me = ob->data; - BMO_op_callf(bm, "bmesh_to_mesh mesh=%p object=%p notesselation=%b", me, ob, TRUE); + BMO_op_callf(bm, "bmesh_to_mesh mesh=%p object=%p notessellation=%b", me, ob, TRUE); } @@ -447,7 +447,7 @@ void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) BMFace *f; BMIter iter, liter; int i, j, *keyi, ototvert, totloop; - int dotess = !BMO_slot_bool_get(op, "notesselation"); + int dotess = !BMO_slot_bool_get(op, "notessellation"); ototvert = me->totvert; @@ -688,7 +688,7 @@ void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) /* go through and find any shapekey customdata layers * that might not have corresponding KeyBlocks, and add them if - * necassary */ + * necessary */ j = 0; for (i = 0; i < bm->vdata.totlayer; i++) { if (bm->vdata.layers[i].type != CD_SHAPEKEY) diff --git a/source/blender/bmesh/operators/bmo_mirror.c b/source/blender/bmesh/operators/bmo_mirror.c index 7990e991431..30704e16a92 100644 --- a/source/blender/bmesh/operators/bmo_mirror.c +++ b/source/blender/bmesh/operators/bmo_mirror.c @@ -119,7 +119,7 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op) BMO_op_finish(bm, &weldop); BMO_op_finish(bm, &dupeop); - BMO_slot_from_flag(bm, op, "newout", ELE_NEW, BM_ALL); + BMO_slot_buffer_from_flag(bm, op, "newout", ELE_NEW, BM_ALL); BLI_array_free(vmap); BLI_array_free(emap); diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c index 09f815f50d5..54b0805df82 100644 --- a/source/blender/bmesh/operators/bmo_primitive.c +++ b/source/blender/bmesh/operators/bmo_primitive.c @@ -283,7 +283,7 @@ void bmo_create_grid_exec(BMesh *bm, BMOperator *op) if (a) BMO_op_finish(bm, &bmop); - BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); + BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); } void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op) @@ -372,7 +372,7 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); + BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); } void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op) @@ -439,7 +439,7 @@ void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); + BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); } void bmo_create_monkey_exec(BMesh *bm, BMOperator *op) @@ -486,7 +486,7 @@ void bmo_create_monkey_exec(BMesh *bm, BMOperator *op) MEM_freeN(tv); - BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); + BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); } @@ -558,7 +558,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op) BMO_op_callf(bm, "dissolve_faces faces=%ff", FACE_NEW); } - BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); + BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); } void bmo_create_cone_exec(BMesh *bm, BMOperator *op) @@ -654,7 +654,7 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op) BM_face_create_quad_tri(bm, v1, v2, firstv2, firstv1, NULL, FALSE); BMO_op_callf(bm, "removedoubles verts=%fv dist=%f", VERT_MARK, 0.000001); - BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); + BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); } void bmo_create_cube_exec(BMesh *bm, BMOperator *op) @@ -732,5 +732,5 @@ void bmo_create_cube_exec(BMesh *bm, BMOperator *op) BM_face_create_quad_tri(bm, v1, v2, v3, v4, NULL, FALSE); BM_face_create_quad_tri(bm, v8, v7, v6, v5, NULL, FALSE); - BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); + BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); } diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c index dce060d326f..fe0801592ea 100644 --- a/source/blender/bmesh/operators/bmo_removedoubles.c +++ b/source/blender/bmesh/operators/bmo_removedoubles.c @@ -510,8 +510,10 @@ void bmesh_finddoubles_common(BMesh *bm, BMOperator *op, BMOperator *optarget, c len = BLI_array_count(verts); for (i = 0; i < len; i++) { v = verts[i]; - if (BMO_elem_flag_test(bm, v, VERT_DOUBLE)) continue; - + if (BMO_elem_flag_test(bm, v, VERT_DOUBLE)) { + continue; + } + for (j = i + 1; j < len; j++) { v2 = verts[j]; diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index c5d370b390a..494185be9d4 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -94,7 +94,7 @@ static BMEdge *connect_smallest_face(BMesh *bm, BMVert *v1, BMVert *v2, BMFace * return NULL; } /* calculates offset for co, based on fractal, sphere or smooth settings */ -static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const subdparams *params, float perc, +static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const SubDParams *params, float perc, BMVert *vsta, BMVert *vend) { float tvec[3], prev_co[3], fac; @@ -177,7 +177,7 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const subdpar /* percent defines the interpolation, rad and flag are for special options */ /* results in new vertex with correct coordinate, vertex normal and weight group info */ static BMVert *bm_subdivide_edge_addvert(BMesh *bm, BMEdge *edge, BMEdge *oedge, - const subdparams *params, float percent, + const SubDParams *params, float percent, float percent2, BMEdge **out, BMVert *vsta, BMVert *vend) { @@ -209,7 +209,7 @@ static BMVert *bm_subdivide_edge_addvert(BMesh *bm, BMEdge *edge, BMEdge *oedge, } static BMVert *subdivideedgenum(BMesh *bm, BMEdge *edge, BMEdge *oedge, - int curpoint, int totpoint, const subdparams *params, + int curpoint, int totpoint, const SubDParams *params, BMEdge **newe, BMVert *vsta, BMVert *vend) { BMVert *ev; @@ -228,7 +228,7 @@ static BMVert *subdivideedgenum(BMesh *bm, BMEdge *edge, BMEdge *oedge, return ev; } -static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const subdparams *params, +static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const SubDParams *params, BMVert *vsta, BMVert *vend) { BMEdge *eed = edge, *newe, temp = *edge; @@ -258,7 +258,7 @@ static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const subdparams *par alter_co(bm, v2, &temp, params, 1.0, &ov1, &ov2); } -/* note: the patterns are rotated as necassary to +/* note: the patterns are rotated as necessary to * match the input geometry. they're based on the * pre-split state of the face */ @@ -271,7 +271,7 @@ static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const subdparams *par * v4---v0---v1 */ static void quad_1edge_split(BMesh *bm, BMFace *UNUSED(face), - BMVert **verts, const subdparams *params) + BMVert **verts, const SubDParams *params) { BMFace *nf; int i, add, numcuts = params->numcuts; @@ -315,7 +315,7 @@ static SubDPattern quad_1edge = { * v7-v0--v1-v2 */ static void quad_2edge_split_path(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, - const subdparams *params) + const SubDParams *params) { BMFace *nf; int i, numcuts = params->numcuts; @@ -341,7 +341,7 @@ static SubDPattern quad_2edge_path = { * v7-v0--v1-v2 */ static void quad_2edge_split_innervert(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, - const subdparams *params) + const SubDParams *params) { BMFace *nf; BMVert *v, *lastv; @@ -382,7 +382,7 @@ static SubDPattern quad_2edge_innervert = { * */ static void quad_2edge_split_fan(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, - const subdparams *params) + const SubDParams *params) { BMFace *nf; /* BMVert *v; */ /* UNUSED */ @@ -413,7 +413,7 @@ static SubDPattern quad_2edge_fan = { * v9-v0--v1-v2 */ static void quad_3edge_split(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, - const subdparams *params) + const SubDParams *params) { BMFace *nf; int i, add = 0, numcuts = params->numcuts; @@ -450,7 +450,7 @@ static SubDPattern quad_3edge = { * it goes from bottom up */ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, - const subdparams *params) + const SubDParams *params) { BMFace *nf; BMVert *v, *v1, *v2; @@ -529,7 +529,7 @@ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts * s s */ static void tri_1edge_split(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, - const subdparams *params) + const SubDParams *params) { BMFace *nf; int i, numcuts = params->numcuts; @@ -555,7 +555,7 @@ static SubDPattern tri_1edge = { * s s */ static void tri_3edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, - const subdparams *params) + const SubDParams *params) { BMFace *nf; BMEdge *e, *ne, temp; @@ -659,18 +659,18 @@ static SubDPattern *patterns[] = { #define PLEN (sizeof(patterns) / sizeof(void *)) -typedef struct subd_facedata { +typedef struct SubDFaceData { BMVert *start; SubDPattern *pat; int totedgesel; //only used if pat was NULL, e.g. no pattern was found BMFace *face; -} subd_facedata; +} SubDFaceData; void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) { BMOpSlot *einput; SubDPattern *pat; - subdparams params; - subd_facedata *facedata = NULL; + SubDParams params; + SubDFaceData *facedata = NULL; BMIter viter, fiter, liter; BMVert *v, **verts = NULL; BMEdge *edge, **edges = NULL; @@ -740,8 +740,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) } /* first go through and tag edge */ - BMO_slot_from_flag(bmesh, op, "edges", - SUBD_SPLIT, BM_EDGE); + BMO_slot_buffer_from_flag(bmesh, op, "edges", SUBD_SPLIT, BM_EDGE); params.numcuts = numcuts; params.op = op; @@ -755,10 +754,10 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) params.off[2] = (float)BLI_drand() * 200.0f; BMO_slot_map_to_flag(bmesh, op, "custompatterns", - FACE_CUSTOMFILL); + FACE_CUSTOMFILL, BM_FACE); BMO_slot_map_to_flag(bmesh, op, "edgepercents", - EDGE_PERCENT); + EDGE_PERCENT, BM_EDGE); for (face = BM_iter_new(&fiter, bmesh, BM_FACES_OF_MESH, NULL); face; @@ -837,7 +836,9 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) for (i = 0; i < PLEN; i++) { pat = patterns[i]; - if (!pat) continue; + if (!pat) { + continue; + } if (pat->len == face->len) { for (a = 0; a < pat->len; a++) { @@ -1004,13 +1005,10 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) BLI_array_free(splits); BLI_array_free(loops); - BMO_slot_from_flag(bmesh, op, "outinner", - ELE_INNER, BM_ALL); - BMO_slot_from_flag(bmesh, op, "outsplit", - ELE_SPLIT, BM_ALL); + BMO_slot_buffer_from_flag(bmesh, op, "outinner", ELE_INNER, BM_ALL); + BMO_slot_buffer_from_flag(bmesh, op, "outsplit", ELE_SPLIT, BM_ALL); - BMO_slot_from_flag(bmesh, op, "geomout", - ELE_INNER|ELE_SPLIT|SUBD_SPLIT, BM_ALL); + BMO_slot_buffer_from_flag(bmesh, op, "geomout", ELE_INNER|ELE_SPLIT|SUBD_SPLIT, BM_ALL); } /* editmesh-emulating functio */ @@ -1082,7 +1080,7 @@ void bmo_edgebisect_exec(BMesh *bm, BMOperator *op) { BMOIter siter; BMEdge *e; - subdparams params; + SubDParams params; int skey; params.numcuts = BMO_slot_get(op, "numcuts")->data.i; @@ -1098,7 +1096,7 @@ void bmo_edgebisect_exec(BMesh *bm, BMOperator *op) bm_subdivide_multicut(bm, e, ¶ms, e->v1, e->v2); } - BMO_slot_from_flag(bm, op, "outsplit", ELE_SPLIT, BM_ALL); + BMO_slot_buffer_from_flag(bm, op, "outsplit", ELE_SPLIT, BM_ALL); BM_data_layer_free_n(bm, &bm->vdata, CD_SHAPEKEY, skey); } diff --git a/source/blender/bmesh/operators/bmo_subdivide.h b/source/blender/bmesh/operators/bmo_subdivide.h index dd5198bdc30..24d621aed8e 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.h +++ b/source/blender/bmesh/operators/bmo_subdivide.h @@ -27,7 +27,7 @@ * \ingroup bmesh */ -typedef struct subdparams { +typedef struct SubDParams { int numcuts; float smooth; float fractal; @@ -36,10 +36,10 @@ typedef struct subdparams { int origkey; /* shapekey holding displaced vertex coordinates for current geometry */ BMOperator *op; float off[3]; -} subdparams; +} SubDParams; typedef void (*subd_pattern_fill_fp)(BMesh *bm, BMFace *face, BMVert **verts, - const subdparams *params); + const SubDParams *params); /* * note: this is a pattern-based edge subdivider. diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c index b3f4fefa36e..4b7c7c49cc5 100644 --- a/source/blender/bmesh/operators/bmo_triangulate.c +++ b/source/blender/bmesh/operators/bmo_triangulate.c @@ -71,8 +71,8 @@ void bmo_triangulate_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_from_flag(bm, op, "edgeout", EDGE_NEW, BM_EDGE); - BMO_slot_from_flag(bm, op, "faceout", FACE_NEW, BM_FACE); + BMO_slot_buffer_from_flag(bm, op, "edgeout", EDGE_NEW, BM_EDGE); + BMO_slot_buffer_from_flag(bm, op, "faceout", FACE_NEW, BM_FACE); BLI_array_free(projectverts); BLI_array_free(newfaces); @@ -151,7 +151,7 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_from_flag(bm, op, "geomout", ELE_NEW, BM_EDGE|BM_FACE); + BMO_slot_buffer_from_flag(bm, op, "geomout", ELE_NEW, BM_EDGE|BM_FACE); } void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) @@ -215,5 +215,5 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", ELE_NEW, BM_FACE|BM_EDGE); BMO_op_finish(bm, &bmop); - BMO_slot_from_flag(bm, op, "geomout", ELE_NEW, BM_EDGE|BM_FACE); + BMO_slot_buffer_from_flag(bm, op, "geomout", ELE_NEW, BM_EDGE|BM_FACE); } diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index b4ac9456abd..6605ef9439f 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -49,7 +49,7 @@ void bmo_makevert_exec(BMesh *bm, BMOperator *op) BMO_slot_vec_get(op, "co", vec); BMO_elem_flag_enable(bm, BM_vert_create(bm, vec, NULL), 1); - BMO_slot_from_flag(bm, op, "newvertout", 1, BM_VERT); + BMO_slot_buffer_from_flag(bm, op, "newvertout", 1, BM_VERT); } void bmo_transform_exec(BMesh *bm, BMOperator *op) @@ -134,7 +134,7 @@ void bmo_edgerotate_exec(BMesh *bm, BMOperator *op) BMO_elem_flag_enable(bm, e2, 1); } - BMO_slot_from_flag(bm, op, "edgeout", 1, BM_EDGE); + BMO_slot_buffer_from_flag(bm, op, "edgeout", 1, BM_EDGE); } #define SEL_FLAG 1 @@ -233,7 +233,7 @@ void bmo_regionextend_exec(BMesh *bm, BMOperator *op) else bmo_regionextend_extend(bm, op, use_faces); - BMO_slot_from_flag(bm, op, "geomout", SEL_FLAG, BM_ALL); + BMO_slot_buffer_from_flag(bm, op, "geomout", SEL_FLAG, BM_ALL); } /********* righthand faces implementation ****** */ @@ -494,7 +494,7 @@ static float ngon_fake_area(BMesh *bm, BMFace *f) /* * extra face data (computed data) */ -typedef struct tmp_face_ext { +typedef struct SimSel_FaceExt { BMFace *f; /* the face */ float c[3]; /* center */ union { @@ -503,7 +503,7 @@ typedef struct tmp_face_ext { float d; /* 4th component of plane (the first three being the normal) */ struct Image *t; /* image pointer */ }; -} tmp_face_ext; +} SimSel_FaceExt; /* * Select similar faces, the choices are in the enum in source/blender/bmesh/bmesh_operators.h @@ -516,7 +516,7 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op) BMOIter fs_iter; int num_sels = 0, num_total = 0, i = 0, idx = 0; float angle = 0.0f; - tmp_face_ext *f_ext = NULL; + SimSel_FaceExt *f_ext = NULL; int *indices = NULL; float t_no[3]; /* temporary normal */ int type = BMO_slot_int_get(op, "type"); @@ -540,7 +540,7 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op) /* allocate memory for the selected faces indices and for all temporary faces */ indices = (int *)MEM_callocN(sizeof(int) * num_sels, "face indices util.c"); - f_ext = (tmp_face_ext *)MEM_callocN(sizeof(tmp_face_ext) * num_total, "f_ext util.c"); + f_ext = (SimSel_FaceExt *)MEM_callocN(sizeof(SimSel_FaceExt) * num_total, "f_ext util.c"); /* loop through all the faces and fill the faces/indices structure */ BM_ITER(fm, &fm_iter, bm, BM_FACES_OF_MESH, NULL) { @@ -660,7 +660,7 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op) MEM_freeN(indices); /* transfer all marked faces to the output slot */ - BMO_slot_from_flag(bm, op, "faceout", FACE_MARK, BM_FACE); + BMO_slot_buffer_from_flag(bm, op, "faceout", FACE_MARK, BM_FACE); } /****************************************************************************** @@ -692,7 +692,7 @@ static float edge_angle(BMesh *bm, BMEdge *e) /* * extra edge information */ -typedef struct tmp_edge_ext { +typedef struct SimSel_EdgeExt { BMEdge *e; union { float dir[3]; @@ -703,7 +703,7 @@ typedef struct tmp_edge_ext { float length; /* edge length */ int faces; /* faces count */ }; -} tmp_edge_ext; +} SimSel_EdgeExt; /* * select similar edges: the choices are in the enum in source/blender/bmesh/bmesh_operators.h @@ -717,7 +717,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op) BMEdge *e; /* mesh edge */ int idx = 0, i = 0 /* , f = 0 */; int *indices = NULL; - tmp_edge_ext *e_ext = NULL; + SimSel_EdgeExt *e_ext = NULL; // float *angles = NULL; float angle; @@ -735,7 +735,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op) /* allocate memory for the selected edges indices and for all temporary edges */ indices = (int *)MEM_callocN(sizeof(int) * num_sels, "indices util.c"); - e_ext = (tmp_edge_ext *)MEM_callocN(sizeof(tmp_edge_ext) * num_total, "e_ext util.c"); + e_ext = (SimSel_EdgeExt *)MEM_callocN(sizeof(SimSel_EdgeExt) * num_total, "e_ext util.c"); /* loop through all the edges and fill the edges/indices structure */ BM_ITER(e, &e_iter, bm, BM_EDGES_OF_MESH, NULL) { @@ -864,7 +864,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op) MEM_freeN(indices); /* transfer all marked edges to the output slot */ - BMO_slot_from_flag(bm, op, "edgeout", EDGE_MARK, BM_EDGE); + BMO_slot_buffer_from_flag(bm, op, "edgeout", EDGE_MARK, BM_EDGE); } /****************************************************************************** @@ -872,13 +872,13 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op) **************************************************************************** */ #define VERT_MARK 1 -typedef struct tmp_vert_ext { +typedef struct SimSel_VertExt { BMVert *v; union { int num_faces; /* adjacent faces */ MDeformVert *dvert; /* deform vertex */ }; -} tmp_vert_ext; +} SimSel_VertExt; /* * select similar vertices: the choices are in the enum in source/blender/bmesh/bmesh_operators.h @@ -890,7 +890,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op) BMIter v_iter; /* mesh verts iterator */ BMVert *vs; /* selected vertex */ BMVert *v; /* mesh vertex */ - tmp_vert_ext *v_ext = NULL; + SimSel_VertExt *v_ext = NULL; int *indices = NULL; int num_total = 0, num_sels = 0, i = 0, idx = 0; int type = BMO_slot_int_get(op, "type"); @@ -906,7 +906,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op) /* allocate memory for the selected vertices indices and for all temporary vertices */ indices = (int *)MEM_mallocN(sizeof(int) * num_sels, "vertex indices"); - v_ext = (tmp_vert_ext *)MEM_mallocN(sizeof(tmp_vert_ext) * num_total, "vertex extra"); + v_ext = (SimSel_VertExt *)MEM_mallocN(sizeof(SimSel_VertExt) * num_total, "vertex extra"); /* loop through all the vertices and fill the vertices/indices structure */ BM_ITER(v, &v_iter, bm, BM_VERTS_OF_MESH, NULL) { @@ -980,7 +980,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op) MEM_freeN(indices); MEM_freeN(v_ext); - BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); + BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); } /****************************************************************************** @@ -1205,12 +1205,12 @@ void bmo_face_reversecolors_exec(BMesh *bm, BMOperator *op) ** shortest vertex path select **************************************************************************** */ -typedef struct element_node { +typedef struct ElemNode { BMVert *v; /* vertex */ BMVert *parent; /* node parent id */ float weight; /* node weight */ HeapNode *hn; /* heap node */ -} element_node; +} ElemNode; void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op) { @@ -1220,7 +1220,7 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op) BMVert *v; /* mesh vertex */ Heap *h = NULL; - element_node *vert_list = NULL; + ElemNode *vert_list = NULL; int num_total = 0 /*, num_sels = 0 */, i = 0; int type = BMO_slot_int_get(op, "type"); @@ -1235,7 +1235,7 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op) num_total = BM_mesh_elem_count(bm, BM_VERT); /* allocate memory for the nodes */ - vert_list = (element_node *)MEM_mallocN(sizeof(element_node) * num_total, "vertex nodes"); + vert_list = (ElemNode *)MEM_mallocN(sizeof(ElemNode) * num_total, "vertex nodes"); /* iterate through all the mesh vertices */ /* loop through all the vertices and fill the vertices/indices structure */ @@ -1308,5 +1308,5 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op) BLI_heap_free(h, NULL); MEM_freeN(vert_list); - BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); + BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT); } diff --git a/source/blender/bmesh/tools/BME_bevel.c b/source/blender/bmesh/tools/BME_bevel.c index 11153215f26..04cee14bf21 100644 --- a/source/blender/bmesh/tools/BME_bevel.c +++ b/source/blender/bmesh/tools/BME_bevel.c @@ -39,6 +39,7 @@ #include "BLI_math.h" #include "BLI_blenlib.h" #include "BLI_ghash.h" +#include "BLI_memarena.h" #include "bmesh.h" #include "bmesh_private.h" @@ -559,7 +560,7 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti /* find saved loop pointer */ l = se->l; while (l->f != jf) { - l = bmesh_radial_loop_next(l); + l = l->radial_next; BLI_assert(l != se->l); } l = l->prev; @@ -605,7 +606,7 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti /* find saved loop pointer */ l = se->l; while (l->f != jf) { - l = bmesh_radial_loop_next(l); + l = l->radial_next; BLI_assert(l != se->l); } } @@ -1026,7 +1027,7 @@ BMesh *BME_bevel(BMEditMesh *em, float value, int res, int options, int defgrp_i BMO_pop(bm); } - BMEdit_RecalcTesselation(em); + BMEdit_RecalcTessellation(em); /* interactive preview? */ if (rtd) { diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index b8bd3ab9fd6..5b1ad604b50 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -1217,7 +1217,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name); if (!pchan) return; - //Fill frame array with key frame values framed at @param:transform_type + //Fill frame array with key frame values framed at \param:transform_type switch (transform_type) { case 0: find_rotation_frames(ob_arm, fra, prefix, pchan->rotmode); diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 05b2b3b738d..90c74d8b226 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -264,7 +264,7 @@ void DocumentImporter::translate_anim_recursive(COLLADAFW::Node *node, COLLADAFW } /** When this method is called, the writer must write the global document asset. - @return The writer should return true, if writing succeeded, false otherwise.*/ + \return The writer should return true, if writing succeeded, false otherwise.*/ bool DocumentImporter::writeGlobalAsset ( const COLLADAFW::FileInfo* asset ) { unit_converter.read_asset(asset); @@ -273,7 +273,7 @@ bool DocumentImporter::writeGlobalAsset ( const COLLADAFW::FileInfo* asset ) } /** When this method is called, the writer must write the scene. - @return The writer should return true, if writing succeeded, false otherwise.*/ + \return The writer should return true, if writing succeeded, false otherwise.*/ bool DocumentImporter::writeScene ( const COLLADAFW::Scene* scene ) { // XXX could store the scene id, but do nothing for now @@ -478,7 +478,7 @@ void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *paren } /** When this method is called, the writer must write the entire visual scene. - @return The writer should return true, if writing succeeded, false otherwise.*/ + \return The writer should return true, if writing succeeded, false otherwise.*/ bool DocumentImporter::writeVisualScene ( const COLLADAFW::VisualScene* visualScene ) { if(mImportStage!=General) @@ -501,7 +501,7 @@ bool DocumentImporter::writeVisualScene ( const COLLADAFW::VisualScene* visualSc /** When this method is called, the writer must handle all nodes contained in the library nodes. - @return The writer should return true, if writing succeeded, false otherwise.*/ + \return The writer should return true, if writing succeeded, false otherwise.*/ bool DocumentImporter::writeLibraryNodes ( const COLLADAFW::LibraryNodes* libraryNodes ) { if(mImportStage!=General) @@ -519,7 +519,7 @@ bool DocumentImporter::writeLibraryNodes ( const COLLADAFW::LibraryNodes* librar } /** When this method is called, the writer must write the geometry. - @return The writer should return true, if writing succeeded, false otherwise.*/ + \return The writer should return true, if writing succeeded, false otherwise.*/ bool DocumentImporter::writeGeometry ( const COLLADAFW::Geometry* geom ) { if(mImportStage!=General) @@ -529,7 +529,7 @@ bool DocumentImporter::writeGeometry ( const COLLADAFW::Geometry* geom ) } /** When this method is called, the writer must write the material. - @return The writer should return true, if writing succeeded, false otherwise.*/ + \return The writer should return true, if writing succeeded, false otherwise.*/ bool DocumentImporter::writeMaterial( const COLLADAFW::Material* cmat ) { if(mImportStage!=General) @@ -717,7 +717,7 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia } /** When this method is called, the writer must write the effect. - @return The writer should return true, if writing succeeded, false otherwise.*/ + \return The writer should return true, if writing succeeded, false otherwise.*/ bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect ) { @@ -756,7 +756,7 @@ bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect ) /** When this method is called, the writer must write the camera. - @return The writer should return true, if writing succeeded, false otherwise.*/ + \return The writer should return true, if writing succeeded, false otherwise.*/ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera ) { if(mImportStage!=General) @@ -872,7 +872,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera ) } /** When this method is called, the writer must write the image. - @return The writer should return true, if writing succeeded, false otherwise.*/ + \return The writer should return true, if writing succeeded, false otherwise.*/ bool DocumentImporter::writeImage( const COLLADAFW::Image* image ) { if(mImportStage!=General) @@ -897,7 +897,7 @@ bool DocumentImporter::writeImage( const COLLADAFW::Image* image ) } /** When this method is called, the writer must write the light. - @return The writer should return true, if writing succeeded, false otherwise.*/ + \return The writer should return true, if writing succeeded, false otherwise.*/ bool DocumentImporter::writeLight( const COLLADAFW::Light* light ) { if(mImportStage!=General) @@ -1089,7 +1089,7 @@ bool DocumentImporter::writeAnimationList( const COLLADAFW::AnimationList* anima } /** When this method is called, the writer must write the skin controller data. - @return The writer should return true, if writing succeeded, false otherwise.*/ + \return The writer should return true, if writing succeeded, false otherwise.*/ bool DocumentImporter::writeSkinControllerData( const COLLADAFW::SkinControllerData* skin ) { return armature_importer.write_skin_controller_data(skin); diff --git a/source/blender/collada/DocumentImporter.h b/source/blender/collada/DocumentImporter.h index 96c587edc44..179461ba59d 100644 --- a/source/blender/collada/DocumentImporter.h +++ b/source/blender/collada/DocumentImporter.h @@ -80,7 +80,7 @@ public: /** This method will be called if an error in the loading process occurred and the loader cannot continue to load. The writer should undo all operations that have been performed. - @param errorMessage A message containing informations about the error that occurred. + \param errorMessage A message containing informations about the error that occurred. */ void cancel(const COLLADAFW::String& errorMessage); diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index e6be35c48a7..d5282249dc3 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -2571,12 +2571,12 @@ static bAnimChannelType ACF_GPL = static bAnimChannelType *animchannelTypeInfo[ANIMTYPE_NUM_TYPES]; static short ACF_INIT= 1; /* when non-zero, the list needs to be updated */ -/* Initialise type info definitions */ +/* Initialize type info definitions */ static void ANIM_init_channel_typeinfo_data (void) { int type= 0; - /* start initialising if necessary... */ + /* start initializing if necessary... */ if (ACF_INIT) { ACF_INIT= 0; @@ -3361,7 +3361,7 @@ void ANIM_channel_draw_widgets (bContext *C, bAnimContext *ac, bAnimListElem *al * - even if we can draw sliders for this view, we must also check that the channel-type supports them * (only only F-Curves really can support them for now) * - to make things easier, we use RNA-autobuts for this so that changes are reflected immediately, - * whereever they occurred. BUT, we don't use the layout engine, otherwise we'd get wrong alignment, + * wherever they occurred. BUT, we don't use the layout engine, otherwise we'd get wrong alignment, * and wouldn't be able to auto-keyframe... * - slider should start before the toggles (if they're visible) to keep a clean line down the side */ diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 0c8d633be5c..20582e40ce4 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -371,7 +371,7 @@ void ANIM_deselect_anim_channels (bAnimContext *ac, void *data, short datatype, * - anim_data: list of the all the anim channels that can be chosen * -> filtered using ANIMFILTER_CHANNELS only, since if we took VISIBLE too, * then the channels under closed expanders get ignored... - * - ale_setting: the anim channel (not in the anim_data list directly, though occuring there) + * - ale_setting: the anim channel (not in the anim_data list directly, though occurring there) * with the new state of the setting that we want flushed up/down the hierarchy * - setting: type of setting to set * - on: whether the visibility setting has been enabled or disabled @@ -955,7 +955,7 @@ static void split_groups_action_temp (bAction *act, bActionGroup *tgrp) } } - /* Initialise memory for temp-group */ + /* Initialize memory for temp-group */ memset(tgrp, 0, sizeof(bActionGroup)); tgrp->flag |= (AGRP_EXPANDED|AGRP_TEMP); BLI_strncpy(tgrp->name, "#TempGroup", sizeof(tgrp->name)); @@ -1788,7 +1788,7 @@ static int animchannels_deselectall_exec (bContext *C, wmOperator *op) if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; - /* 'standard' behaviour - check if selected, then apply relevant selection */ + /* 'standard' behavior - check if selected, then apply relevant selection */ if (RNA_boolean_get(op->ptr, "invert")) ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 0, ACHANNEL_SETFLAG_TOGGLE); else diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 3f851938a83..8e91e575db1 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -115,7 +115,7 @@ void ANIM_id_update(Scene *UNUSED(scene), ID *id) } /* **************************** animation data <-> data syncing ******************************** */ -/* This code here is used to synchronise the +/* This code here is used to synchronize the * - selection (to find selected data easier) * - ... (insert other relevant items here later) * status in relevant Blender data with the status stored in animation channels. diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 32e5fe82ed4..714c3276769 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -189,7 +189,7 @@ static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time) /* get timecode string * - padding on str-buf passed so that it doesn't sit on the frame indicator - * - power = 0, gives 'standard' behaviour for time + * - power = 0, gives 'standard' behavior for time * but power = 1 is required for frames (to get integer frames) */ if (time) diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 00c849ed02d..7e92c9eb690 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -232,7 +232,7 @@ void ED_markers_get_minmax (ListBase *markers, short sel, float *first, float *l selcount= BLI_countlist(markers); /* if only selected are to be considered, only consider the selected ones - * (optimisation for not searching list) + * (optimization for not searching list) */ if (selcount > 1) { for (marker= markers->first; marker; marker= marker->next) { @@ -323,7 +323,7 @@ TimeMarker *ED_markers_get_first_selected(ListBase *markers) /* --------------------------------- */ /* Print debugging prints of list of markers - * BSI's: do NOT make static or put in if-defs as "unused code". That's too much trouble when we need to use for quick debuggging! + * BSI's: do NOT make static or put in if-defs as "unused code". That's too much trouble when we need to use for quick debugging! */ void debug_markers_print_list(ListBase *markers) { @@ -933,7 +933,7 @@ static void ed_marker_duplicate_apply(bContext *C) return; /* go through the list of markers, duplicate selected markers and add duplicated copies - * to the begining of the list (unselect original markers) + * to the beginning of the list (unselect original markers) */ for (marker= markers->first; marker; marker= marker->next) { if (marker->flag & SELECT) { @@ -950,7 +950,7 @@ static void ed_marker_duplicate_apply(bContext *C) newmarker->camera= marker->camera; #endif - /* new marker is added to the begining of list */ + /* new marker is added to the beginning of list */ // FIXME: bad ordering! BLI_addhead(markers, newmarker); } @@ -1339,7 +1339,7 @@ static int ed_marker_rename_exec(bContext *C, wmOperator *op) static int ed_marker_rename_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) { - /* must initialise the marker name first if there is a marker selected */ + /* must initialize the marker name first if there is a marker selected */ TimeMarker *marker = ED_markers_get_first_selected(ED_context_get_markers(C)); if (marker) RNA_string_set(op->ptr, "name", marker->name); diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 05f9248e0a6..0b63a0ad752 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -175,7 +175,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s } break; - case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* factorised polynomial expression */ + case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* Factorized polynomial expression */ { float *cp = NULL; unsigned int i; @@ -312,7 +312,7 @@ static int binarysearch_fcm_envelopedata_index (FCM_EnvelopeData array[], float int start=0, end=arraylen; int loopbreaker= 0, maxloop= arraylen * 2; - /* initialise exists-flag first */ + /* initialize exists-flag first */ *exists= 0; /* sneaky optimisations (don't go through searching process if...): diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index c1e81cd0901..8b93688f4cb 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -374,7 +374,7 @@ static void add_bezt_to_keyblocks_list(DLRBT_Tree *blocks, DLRBT_Tree *beztTree, ActKeyBlock *ab, *abn=NULL; /* try to find a keyblock that starts on the previous beztriple, and add a new one if none start there - * Note: we can't search from end to try to optimise this as it causes errors there's + * Note: we can't search from end to try to optimize this as it causes errors there's * an A ___ B |---| B situation */ // FIXME: here there is a bug where we are trying to get the summary for the following channels @@ -499,7 +499,7 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel static GLuint displist1=0; static GLuint displist2=0; - /* initialise 2 display lists for diamond shape - one empty, one filled */ + /* initialize 2 display lists for diamond shape - one empty, one filled */ if (displist1 == 0) { displist1= glGenLists(1); glNewList(displist1, GL_COMPILE); @@ -621,7 +621,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa float kalpha = (channelLocked)? 0.35f : 1.0f; for (ak= keys->first; ak; ak= ak->next) { - /* optimisation: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw + /* optimization: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw * - this might give some improvements, since we current have to flip between view/region matrices */ if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax) == 0) diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 5557923c3d6..5e617979716 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -446,7 +446,7 @@ static short new_key_needed (FCurve *fcu, float cFrame, float nValue) } else { /* just add a keyframe if there's only one keyframe - * and the new one occurs before the exisiting one does. + * and the new one occurs before the existing one does. */ if ((cFrame < beztPosi) && (totCount==1)) return KEYNEEDED_JUSTADD; @@ -755,7 +755,7 @@ static float visualkey_get_value (PointerRNA *ptr, PropertyRNA *prop, int array_ * Use this when validation of necessary animation data is not necessary, since an RNA-pointer to the necessary * data being keyframed, and a pointer to the F-Curve to use have both been provided. * - * The flag argument is used for special settings that alter the behaviour of + * The flag argument is used for special settings that alter the behavior of * the keyframe insertion. These include the 'visual' keyframing modes, quick refresh, * and extra keyframe filtering. */ @@ -874,7 +874,7 @@ short insert_keyframe_direct (ReportList *reports, PointerRNA ptr, PropertyRNA * /* Main Keyframing API call: * Use this when validation of necessary animation data is necessary, since it may not exist yet. * - * The flag argument is used for special settings that alter the behaviour of + * The flag argument is used for special settings that alter the behavior of * the keyframe insertion. These include the 'visual' keyframing modes, quick refresh, * and extra keyframe filtering. * @@ -968,7 +968,7 @@ short insert_keyframe (ReportList *reports, ID *id, bAction *act, const char gro * Use this when validation of necessary animation data isn't necessary as it * already exists. It will delete a keyframe at the current frame. * - * The flag argument is used for special settings that alter the behaviour of + * The flag argument is used for special settings that alter the behavior of * the keyframe deletion. These include the quick refresh options. */ short delete_keyframe (ReportList *reports, ID *id, bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short UNUSED(flag)) @@ -1239,8 +1239,8 @@ void ANIM_OT_keyframe_insert_menu (wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN); /* whether the menu should always be shown - * - by default, the menu should only be shown when there is no active Keying Set (2.5 behaviour), - * although in some cases it might be useful to always shown (pre 2.5 behaviour) + * - by default, the menu should only be shown when there is no active Keying Set (2.5 behavior), + * although in some cases it might be useful to always shown (pre 2.5 behavior) */ prop= RNA_def_boolean(ot->srna, "always_prompt", 0, "Always Show Menu", ""); RNA_def_property_flag(prop, PROP_HIDDEN); @@ -1711,7 +1711,7 @@ short id_frame_has_keyframe (ID *id, float frame, short filter) break; case ID_SCE: /* scene */ - // XXX TODO... for now, just use 'normal' behaviour + // XXX TODO... for now, just use 'normal' behavior // break; default: /* 'normal type' */ diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 25432260387..5d440bae2bc 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -839,7 +839,7 @@ typedef struct tRKS_DSource { } tRKS_DSource; -/* Iterator used for overriding the behaviour of iterators defined for +/* Iterator used for overriding the behavior of iterators defined for * relative Keying Sets, with the main usage of this being operators * requiring Auto Keyframing. Internal Use Only! */ diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 59645f10677..27a18980b34 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -4297,7 +4297,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor * armature object was not active yet. * note, special exception for armature mode so we can do multi-select * we could check for multi-select explicitly but think its fine to - * always give pradictable behavior in weight paint mode - campbell */ + * always give predictable behavior in weight paint mode - campbell */ if (!extend || ((ob_act && (ob_act != ob) && (ob_act->mode & OB_MODE_WEIGHT_PAINT)==0))) { ED_pose_deselectall(ob, 0); nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 41a7b20de3d..9ea731150e8 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -1799,7 +1799,7 @@ void sk_applyCutGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED SK_Point pt; pt.type = PT_EXACT; - pt.mode = PT_PROJECT; /* take mode from neighbouring points */ + pt.mode = PT_PROJECT; /* take mode from neighboring points */ copy_v3_v3(pt.p, isect->p); copy_v3_v3(pt.no, isect->stroke->points[isect->before].no); @@ -1841,7 +1841,7 @@ void sk_applyTrimGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSE float stroke_dir[3]; pt.type = PT_EXACT; - pt.mode = PT_PROJECT; /* take mode from neighbouring points */ + pt.mode = PT_PROJECT; /* take mode from neighboring points */ copy_v3_v3(pt.p, isect->p); copy_v3_v3(pt.no, isect->stroke->points[isect->before].no); diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index e2b89ba90e1..a592e727988 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -1494,7 +1494,7 @@ static float meshdeform_boundary_total_weight(MeshDeformBind *mdb, int x, int y, a= meshdeform_index(mdb, x, y, z, 0); - /* count weight for neighbour cells */ + /* count weight for neighbor cells */ for(i=1; i<=6; i++) { if(meshdeform_index(mdb, x, y, z, i) == -1) continue; diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c index c28b688e377..8698ac00913 100644 --- a/source/blender/editors/armature/poseSlide.c +++ b/source/blender/editors/armature/poseSlide.c @@ -159,7 +159,7 @@ static int pose_slide_init (bContext *C, wmOperator *op, short mode) pso->ob->pose->flag |= POSE_LOCKED; pso->ob->pose->flag &= ~POSE_DO_UNLOCK; - /* do basic initialise of RB-BST used for finding keyframes, but leave the filling of it up + /* do basic initialize of RB-BST used for finding keyframes, but leave the filling of it up * to the caller of this (usually only invoke() will do it, to make things more efficient). */ BLI_dlrbTree_init(&pso->keys); @@ -730,7 +730,7 @@ static int pose_slide_push_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED( { tPoseSlideOp *pso; - /* initialise data */ + /* initialize data */ if (pose_slide_init(C, op, POSESLIDE_PUSH) == 0) { pose_slide_exit(op); return OPERATOR_CANCELLED; @@ -747,7 +747,7 @@ static int pose_slide_push_exec (bContext *C, wmOperator *op) { tPoseSlideOp *pso; - /* initialise data (from RNA-props) */ + /* initialize data (from RNA-props) */ if (pose_slide_init(C, op, POSESLIDE_PUSH) == 0) { pose_slide_exit(op); return OPERATOR_CANCELLED; @@ -787,7 +787,7 @@ static int pose_slide_relax_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED { tPoseSlideOp *pso; - /* initialise data */ + /* initialize data */ if (pose_slide_init(C, op, POSESLIDE_RELAX) == 0) { pose_slide_exit(op); return OPERATOR_CANCELLED; @@ -804,7 +804,7 @@ static int pose_slide_relax_exec (bContext *C, wmOperator *op) { tPoseSlideOp *pso; - /* initialise data (from RNA-props) */ + /* initialize data (from RNA-props) */ if (pose_slide_init(C, op, POSESLIDE_RELAX) == 0) { pose_slide_exit(op); return OPERATOR_CANCELLED; @@ -844,7 +844,7 @@ static int pose_slide_breakdown_invoke (bContext *C, wmOperator *op, wmEvent *UN { tPoseSlideOp *pso; - /* initialise data */ + /* initialize data */ if (pose_slide_init(C, op, POSESLIDE_BREAKDOWN) == 0) { pose_slide_exit(op); return OPERATOR_CANCELLED; @@ -861,7 +861,7 @@ static int pose_slide_breakdown_exec (bContext *C, wmOperator *op) { tPoseSlideOp *pso; - /* initialise data (from RNA-props) */ + /* initialize data (from RNA-props) */ if (pose_slide_init(C, op, POSESLIDE_BREAKDOWN) == 0) { pose_slide_exit(op); return OPERATOR_CANCELLED; @@ -1231,7 +1231,7 @@ static int pose_propagate_exec (bContext *C, wmOperator *op) void POSE_OT_propagate (wmOperatorType *ot) { static EnumPropertyItem terminate_items[]= { - {POSE_PROPAGATE_SMART_HOLDS, "WHILE_HELD", 0, "While Held", "Propagate pose to all keyframes after current frame that don't change (Default behaviour)"}, + {POSE_PROPAGATE_SMART_HOLDS, "WHILE_HELD", 0, "While Held", "Propagate pose to all keyframes after current frame that don't change (Default behavior)"}, {POSE_PROPAGATE_NEXT_KEY, "NEXT_KEY", 0, "To Next Keyframe", "Propagate pose to first keyframe following the current frame only"}, {POSE_PROPAGATE_LAST_KEY, "LAST_KEY", 0, "To Last Keyframe", "Propagate pose to the last keyframe only (i.e. making action cyclic)"}, {POSE_PROPAGATE_BEFORE_FRAME, "BEFORE_FRAME", 0, "Before Frame", "Propagate pose to all keyframes between current frame and 'Frame' property"}, diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 5ce44cb7a58..cd3017c0e0f 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -186,7 +186,7 @@ static int has_poselib_pose_data_poll (bContext *C) /* ----------------------------------- */ -/* Initialise a new poselib (whether it is needed or not) */ +/* Initialize a new poselib (whether it is needed or not) */ static bAction *poselib_init_new (Object *ob) { /* sanity checks - only for armatures */ @@ -201,7 +201,7 @@ static bAction *poselib_init_new (Object *ob) return ob->poselib; } -/* Initialise a new poselib (checks if that needs to happen) */ +/* Initialize a new poselib (checks if that needs to happen) */ static bAction *poselib_validate (Object *ob) { if (ELEM(NULL, ob, ob->pose)) diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index dc4af18be11..0d1a7c7173b 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -497,7 +497,7 @@ static short pose_select_same_group (bContext *C, Object *ob, short extend) } CTX_DATA_END; - /* small optimisation: only loop through bones a second time if there are any groups tagged */ + /* small optimization: only loop through bones a second time if there are any groups tagged */ if (tagged) { /* only if group matches (and is not selected or current bone) */ CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pose_bones) @@ -1164,7 +1164,7 @@ static int pose_paste_exec (bContext *C, wmOperator *op) } /* if selOnly option is enabled, if user hasn't selected any bones, - * just go back to default behaviour to be more in line with other pose tools + * just go back to default behavior to be more in line with other pose tools */ if (selOnly) { if (CTX_DATA_COUNT(C, selected_pose_bones) == 0) diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index e05f61de9dd..c09f4d16936 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -2367,7 +2367,7 @@ void CURVE_OT_smooth_radius(wmOperatorType *ot) /* next == 1 -> select next */ /* next == -1 -> select previous */ /* cont == 1 -> select continuously */ -/* selstatus, inverts behaviour */ +/* selstatus, inverts behavior */ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short selstatus) { Nurb *nu; @@ -5084,7 +5084,7 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op)) short *selbpoints; /* note that NURBS surface is a special case because we mimic */ - /* the behaviour of "select more" of mesh tools. */ + /* the behavior of "select more" of mesh tools. */ /* The algorithm is designed to work in planar cases so it */ /* may not be optimal always (example: end of NURBS sphere) */ if(obedit->type==OB_SURF) { diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index cf3961e0820..19dc25dd282 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -286,7 +286,7 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness_s glEnd(); } - /* tesselation code - draw stroke as series of connected quads with connection + /* tessellation code - draw stroke as series of connected quads with connection * edges rotated to minimise shrinking artifacts, and rounded endcaps */ else diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c index 81a5f6777e7..c932eb4c7d0 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -580,7 +580,7 @@ static short mirror_gpf_marker (bGPDframe *gpf, Scene *scene) } } else { - /* initialisation time */ + /* initialization time */ if (initialised) { /* reset everything for safety */ marker = NULL; diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 53ef16a70a0..46241f3d378 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -293,7 +293,7 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi } -/* Standard panel to be included whereever Grease Pencil is used... */ +/* Standard panel to be included wherever Grease Pencil is used... */ void gpencil_panel_standard(const bContext *C, Panel *pa) { bGPdata **gpd_ptr = NULL; diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 8d2454ffac4..673d7c637ff 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -524,7 +524,7 @@ static void gp_stroke_simplify (tGPsdata *p) float co[2], pressure; int mco[2]; - /* initialise values */ + /* initialize values */ co[0]= 0; co[1]= 0; pressure = 0; @@ -701,7 +701,7 @@ static void gp_stroke_newfrombuffer (tGPsdata *p) pt= gps->points; - /* convert all points (normal behaviour) */ + /* convert all points (normal behavior) */ for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size && ptc; i++, ptc++, pt++) { /* convert screen-coordinates to appropriate coordinates (and store them) */ gp_stroke_convertcoords(p, &ptc->x, &pt->x, depth_arr ? depth_arr+i:NULL); @@ -802,7 +802,7 @@ static short gp_stroke_eraser_strokeinside (int mval[], int UNUSED(mvalo[]), sho } /* eraser tool - evaluation per stroke */ -// TODO: this could really do with some optimisation (KD-Tree/BVH?) +// TODO: this could really do with some optimization (KD-Tree/BVH?) static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], short rad, rcti *rect, bGPDframe *gpf, bGPDstroke *gps) { bGPDspoint *pt1, *pt2; @@ -1600,7 +1600,7 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op) //printf("GPencil - Starting Re-Drawing \n"); - /* try to initialise context data needed while drawing */ + /* try to initialize context data needed while drawing */ if (!gpencil_draw_init(C, op)) { if (op->customdata) MEM_freeN(op->customdata); //printf("\tGP - no valid data \n"); @@ -1674,7 +1674,7 @@ static int gpencil_draw_invoke (bContext *C, wmOperator *op, wmEvent *event) if (G.f & G_DEBUG) printf("GPencil - Starting Drawing \n"); - /* try to initialise context data needed while drawing */ + /* try to initialize context data needed while drawing */ if (!gpencil_draw_init(C, op)) { if (op->customdata) MEM_freeN(op->customdata); @@ -1938,7 +1938,7 @@ void GPENCIL_OT_draw (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* settings for drawing */ - RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements"); + RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to interpret mouse movements"); RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); } diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index b5dbf906d84..77c50f9ca6d 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -55,27 +55,27 @@ extern unsigned char stipple_diag_stripes_neg[128]; /** * Draw a lined (non-looping) arc with the given - * @a radius, starting at angle @a start and arcing - * through @a angle. The arc is centered at the origin + * \a radius, starting at angle \a start and arcing + * through \a angle. The arc is centered at the origin * and drawn in the XY plane. * - * @param start The initial angle (in radians). - * @param angle The length of the arc (in radians). - * @param radius The arc radius. - * @param nsegments The number of segments to use in drawing the arc. + * \param start The initial angle (in radians). + * \param angle The length of the arc (in radians). + * \param radius The arc radius. + * \param nsegments The number of segments to use in drawing the arc. */ void glutil_draw_lined_arc (float start, float angle, float radius, int nsegments); /** - * Draw a filled arc with the given @a radius, - * starting at angle @a start and arcing through - * @a angle. The arc is centered at the origin + * Draw a filled arc with the given \a radius, + * starting at angle \a start and arcing through + * \a angle. The arc is centered at the origin * and drawn in the XY plane. * - * @param start The initial angle (in radians). - * @param angle The length of the arc (in radians). - * @param radius The arc radius. - * @param nsegments The number of segments to use in drawing the arc. + * \param start The initial angle (in radians). + * \param angle The length of the arc (in radians). + * \param radius The arc radius. + * \param nsegments The number of segments to use in drawing the arc. */ void glutil_draw_filled_arc (float start, float angle, float radius, int nsegments); @@ -93,11 +93,11 @@ float glaGetOneFloat (int param); /** * Functions like glRasterPos2i, except ensures that the resulting - * raster position is valid. @a known_good_x and @a known_good_y + * raster position is valid. \a known_good_x and \a known_good_y * should be coordinates of a point known to be within the current * view frustum. - * @attention This routine should be used when the distance of @a x - * and @a y away from the known good point is small (ie. for small icons + * \attention This routine should be used when the distance of \a x + * and \a y away from the known good point is small (ie. for small icons * and for bitmap characters), when drawing large+zoomed images it is * possible for overflow to occur, the glaDrawPixelsSafe routine should * be used instead. @@ -106,20 +106,20 @@ void glaRasterPosSafe2f (float x, float y, float known_good_x, float known_good /** * Functions like a limited glDrawPixels, except ensures that - * the image is displayed onscreen even if the @a x and @a y + * the image is displayed onscreen even if the \a x and \a y * coordinates for would be clipped. The routine respects the * glPixelZoom values, pixel unpacking parameters are _not_ * respected. - * @attention This routine makes many assumptions: the rect data + * \attention This routine makes many assumptions: the rect data * is expected to be in RGBA unsigned byte format, the coordinate * (0.375, 0.375) is assumed to be within the view frustum, and the * modelview and projection matrices are assumed to define a * 1-to-1 mapping to screen space. - * @attention Furthmore, in the case of zoomed or unpixel aligned + * \attention Furthmore, in the case of zoomed or unpixel aligned * images extending outside the view frustum, but still within the * window, some portion of the image may be visible left and/or - * below of the given @a x and @a y coordinates. It is recommended + * below of the given \a x and \a y coordinates. It is recommended * to use the glScissor functionality if images are to be drawn * with an inset view matrix. */ @@ -132,7 +132,7 @@ void glaDrawPixelsSafe (float x, float y, int img_w, int img_h, int row_w, int * clipped when offscreen. The routine respects the glPixelZoom values, * pixel unpacking parameters are _not_ respected. - * @attention This routine makes many assumptions: the rect data + * \attention This routine makes many assumptions: the rect data * is expected to be in RGBA byte or float format, and the * modelview and projection matrices are assumed to define a * 1-to-1 mapping to screen space. @@ -152,7 +152,7 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, * thus no reason to +-0.5 the coordinates or perform other silly * tricks. * - * @param screen_rect The screen rectangle to be defined for 2D drawing. + * \param screen_rect The screen rectangle to be defined for 2D drawing. */ void glaDefine2DArea (struct rcti *screen_rect); @@ -170,17 +170,17 @@ typedef struct gla2DDrawInfo gla2DDrawInfo; * thus no reason to +-0.5 the coordinates or perform other silly * tricks. * - * @param screen_rect The screen rectangle to be used for 2D drawing. - * @param world_rect The world rectangle that the 2D area represented - * by @a screen_rect is supposed to represent. If NULL it is assumed the + * \param screen_rect The screen rectangle to be used for 2D drawing. + * \param world_rect The world rectangle that the 2D area represented + * by \a screen_rect is supposed to represent. If NULL it is assumed the * world has a 1 to 1 mapping to the screen. */ gla2DDrawInfo* glaBegin2DDraw (struct rcti *screen_rect, struct rctf *world_rect); - /** Translate the (@a wo_x, @a wo_y) point from world coordinates into screen space. */ + /** Translate the (\a wo_x, \a wo_y) point from world coordinates into screen space. */ void gla2DDrawTranslatePt (gla2DDrawInfo *di, float wo_x, float wo_y, int *sc_x_r, int *sc_y_r); - /** Translate the @a world point from world coordiantes into screen space. */ + /** Translate the \a world point from world coordiantes into screen space. */ void gla2DDrawTranslatePtv (gla2DDrawInfo *di, float world[2], int screen_r[2]); /* Restores the previous OpenGL state and free's the auxilary diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 9167b6c30d2..a8dc33ffccd 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -341,7 +341,7 @@ short ANIM_animdata_context_getdata(bAnimContext *ac); /* ------------------------ Drawing TypeInfo -------------------------- */ -/* flag-setting behaviour */ +/* flag-setting behavior */ typedef enum eAnimChannels_SetFlag { ACHANNEL_SETFLAG_CLEAR = 0, /* turn off */ ACHANNEL_SETFLAG_ADD, /* turn on */ @@ -360,7 +360,7 @@ typedef enum eAnimChannel_Settings { } eAnimChannel_Settings; -/* Drawing, mouse handling, and flag setting behaviour... */ +/* Drawing, mouse handling, and flag setting behavior... */ typedef struct bAnimChannelType { /* type data */ /* name of the channel type, for debugging */ @@ -429,7 +429,7 @@ void ANIM_channel_setting_set(bAnimContext *ac, bAnimListElem *ale, int setting, * - anim_data: list of the all the anim channels that can be chosen * -> filtered using ANIMFILTER_CHANNELS only, since if we took VISIBLE too, * then the channels under closed expanders get ignored... - * - ale_setting: the anim channel (not in the anim_data list directly, though occuring there) + * - ale_setting: the anim channel (not in the anim_data list directly, though occurring there) * with the new state of the setting that we want flushed up/down the hierarchy * - setting: type of setting to set * - on: whether the visibility setting has been enabled or disabled diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 4b43233fe40..986c2abad69 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -292,7 +292,7 @@ void ED_mesh_vertices_remove(struct Mesh *mesh, struct ReportList *reports, int void ED_mesh_transform(struct Mesh *me, float *mat); void ED_mesh_calc_normals(struct Mesh *me); void ED_mesh_material_link(struct Mesh *me, struct Material *ma); -void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges); +void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges, int calc_tessface); int ED_mesh_uv_texture_add(struct bContext *C, struct Mesh *me, const char *name, int active_set); int ED_mesh_uv_texture_remove(struct bContext *C, struct Object *ob, struct Mesh *me); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 4c68b53d5cd..23321e0e48f 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -91,10 +91,10 @@ int initgrabz(struct RegionView3D *rv3d, float x, float y, float z); /** * Calculate a 3d location from 2d window coordinates. - * @param ar The region (used for the window width and height). - * @param depth_pt The reference location used to calculate the Z depth. - * @param mval The area relative location (such as event->mval converted to floats). - * @param out The resulting world-space location. + * \param ar The region (used for the window width and height). + * \param depth_pt The reference location used to calculate the Z depth. + * \param mval The area relative location (such as event->mval converted to floats). + * \param out The resulting world-space location. */ void ED_view3d_win_to_3d(struct ARegion *ar, const float depth_pt[3], const float mval[2], float out[3]); @@ -102,9 +102,9 @@ void ED_view3d_win_to_3d(struct ARegion *ar, const float depth_pt[3], const floa * Calculate a 3d difference vector from 2d window offset. * note that initgrabz() must be called first to determine * the depth used to calculate the delta. - * @param ar The region (used for the window width and height). - * @param mval The area relative 2d difference (such as event->mval[0] - other_x). - * @param out The resulting world-space delta. + * \param ar The region (used for the window width and height). + * \param mval The area relative 2d difference (such as event->mval[0] - other_x). + * \param out The resulting world-space delta. */ void ED_view3d_win_to_delta(struct ARegion *ar, const float mval[2], float out[3]); @@ -112,9 +112,9 @@ void ED_view3d_win_to_delta(struct ARegion *ar, const float mval[2], float out[3 * Calculate a 3d direction vector from 2d window coordinates. * This direction vector starts and the view in the direction of the 2d window coordinates. * In orthographic view all window coordinates yield the same vector. - * @param ar The region (used for the window width and height). - * @param mval The area relative 2d location (such as event->mval converted to floats). - * @param out The resulting normalized world-space direction vector. + * \param ar The region (used for the window width and height). + * \param mval The area relative 2d location (such as event->mval converted to floats). + * \param out The resulting normalized world-space direction vector. */ void ED_view3d_win_to_vector(struct ARegion *ar, const float mval[2], float out[3]); @@ -124,11 +124,11 @@ void ED_view3d_win_to_vector(struct ARegion *ar, const float mval[2], float out[ * ray_start and ray_end are clipped by the view near and far limits * so points along this line are always in view. * In orthographic view all resulting segments will be parallel. - * @param ar The region (used for the window width and height). - * @param v3d The 3d viewport (used for near and far clipping range). - * @param mval The area relative 2d location (such as event->mval, converted into float[2]). - * @param ray_start The world-space starting point of the segment. - * @param ray_end The world-space end point of the segment. + * \param ar The region (used for the window width and height). + * \param v3d The 3d viewport (used for near and far clipping range). + * \param mval The area relative 2d location (such as event->mval, converted into float[2]). + * \param ray_start The world-space starting point of the segment. + * \param ray_end The world-space end point of the segment. */ void ED_view3d_win_to_segment_clip(struct ARegion *ar, struct View3D *v3d, const float mval[2], float ray_start[3], float ray_end[3]); @@ -137,58 +137,58 @@ void ED_view3d_win_to_segment_clip(struct ARegion *ar, struct View3D *v3d, const * This ray_start is located at the viewpoint, ray_normal is the direction towards mval. * ray_start is clipped by the view near limit so points in front of it are always in view. * In orthographic view the resulting ray_normal will match the view vector. - * @param ar The region (used for the window width and height). - * @param v3d The 3d viewport (used for near clipping value). - * @param mval The area relative 2d location (such as event->mval, converted into float[2]). - * @param ray_start The world-space starting point of the segment. - * @param ray_normal The normalized world-space direction of towards mval. + * \param ar The region (used for the window width and height). + * \param v3d The 3d viewport (used for near clipping value). + * \param mval The area relative 2d location (such as event->mval, converted into float[2]). + * \param ray_start The world-space starting point of the segment. + * \param ray_normal The normalized world-space direction of towards mval. */ void ED_view3d_win_to_ray(struct ARegion *ar, struct View3D *v3d, const float mval[2], float ray_start[3], float ray_normal[3]); /** * Calculate a normalized 3d direction vector from the viewpoint towards a global location. * In orthographic view the resulting vector will match the view vector. - * @param rv3d The region (used for the window width and height). - * @param coord The world-space location. - * @param vec The resulting normalized vector. + * \param rv3d The region (used for the window width and height). + * \param coord The world-space location. + * \param vec The resulting normalized vector. */ void ED_view3d_global_to_vector(struct RegionView3D *rv3d, const float coord[3], float vec[3]); /** * Calculate the view transformation matrix from RegionView3D input. * The resulting matrix is equivalent to RegionView3D.viewinv - * @param mat The view 4x4 transformation matrix to calculate. - * @param ofs The view offset, normally from RegionView3D.ofs. - * @param quat The view rotation, quaternion normally from RegionView3D.viewquat. - * @param dist The view distance from ofs, normally from RegionView3D.dist. + * \param mat The view 4x4 transformation matrix to calculate. + * \param ofs The view offset, normally from RegionView3D.ofs. + * \param quat The view rotation, quaternion normally from RegionView3D.viewquat. + * \param dist The view distance from ofs, normally from RegionView3D.dist. */ void ED_view3d_to_m4(float mat[][4], const float ofs[3], const float quat[4], const float dist); /** * Set the view transformation from a 4x4 matrix. - * @param mat The view 4x4 transformation matrix to assign. - * @param ofs The view offset, normally from RegionView3D.ofs. - * @param quat The view rotation, quaternion normally from RegionView3D.viewquat. - * @param dist The view distance from ofs, normally from RegionView3D.dist. + * \param mat The view 4x4 transformation matrix to assign. + * \param ofs The view offset, normally from RegionView3D.ofs. + * \param quat The view rotation, quaternion normally from RegionView3D.viewquat. + * \param dist The view distance from ofs, normally from RegionView3D.dist. */ void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist); /** * Set the RegionView3D members from an objects transformation and optionally lens. - * @param ob The object to set the view to. - * @param ofs The view offset to be set, normally from RegionView3D.ofs. - * @param quat The view rotation to be set, quaternion normally from RegionView3D.viewquat. - * @param dist The view distance from ofs to be set, normally from RegionView3D.dist. - * @param lens The view lens angle set for cameras and lamps, normally from View3D.lens. + * \param ob The object to set the view to. + * \param ofs The view offset to be set, normally from RegionView3D.ofs. + * \param quat The view rotation to be set, quaternion normally from RegionView3D.viewquat. + * \param dist The view distance from ofs to be set, normally from RegionView3D.dist. + * \param lens The view lens angle set for cameras and lamps, normally from View3D.lens. */ void ED_view3d_from_object(struct Object *ob, float ofs[3], float quat[4], float *dist, float *lens); /** * Set the object transformation from RegionView3D members. - * @param ob The object which has the transformation assigned. - * @param ofs The view offset, normally from RegionView3D.ofs. - * @param quat The view rotation, quaternion normally from RegionView3D.viewquat. - * @param dist The view distance from ofs, normally from RegionView3D.dist. + * \param ob The object which has the transformation assigned. + * \param ofs The view offset, normally from RegionView3D.ofs. + * \param quat The view rotation, quaternion normally from RegionView3D.viewquat. + * \param dist The view distance from ofs, normally from RegionView3D.dist. */ void ED_view3d_to_object(struct Object *ob, const float ofs[3], const float quat[4], const float dist); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 880c5c049ca..fafd35bf911 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -497,7 +497,7 @@ int uiButGetUnitType(uiBut *but); /* Special Buttons * - * Butons with a more specific purpose: + * Buttons with a more specific purpose: * - IDPoinBut: for creating buttons that work on a pointer to an ID block. * - MenuBut: buttons that popup a menu (in headers usually). * - PulldownBut: like MenuBut, but creating a uiBlock (for compatibility). diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 8bb9ceb121c..1944f81ec2d 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -3384,7 +3384,7 @@ int uiButGetUnitType(uiBut *but) { int ownUnit = (int)but->unit_type; - /* own unit define always takes precidence over RNA provided, allowing for overriding + /* own unit define always takes precedence over RNA provided, allowing for overriding * default value provided in RNA in a few special cases (i.e. Active Keyframe in Graph Edit) */ // XXX: this doesn't allow clearing unit completely, though the same could be said for icons diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 2e0d4323fa5..41385292707 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1474,7 +1474,7 @@ static void ui_textedit_set_cursor_select(uiBut *but, uiHandleButtonData *data, } /* this is used for both utf8 and ascii, its meant to be used for single keys, - * notie the buffer is either copied or not, so its not suitable for pasting in + * notice the buffer is either copied or not, so its not suitable for pasting in * - campbell */ static int ui_textedit_type_buf(uiBut *but, uiHandleButtonData *data, const char *utf8_buf, int utf8_buf_len) @@ -3034,7 +3034,7 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm ui_apply_button(C, but->block, but, data, 1); /* button's state need to be changed to EXIT so moving mouse away from this mouse wouldn't lead - * to cancel changes made to this button, but shanging state to EXIT also makes no button active for + * to cancel changes made to this button, but changing state to EXIT also makes no button active for * a while which leads to triggering operator when doing fast scrolling mouse wheel. * using post activate stuff from button allows to make button be active again after checking for all * all that mouse leave and cancel stuff, so wuick scrool wouldnt't be an issue anumore. diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index c912bce1c77..32f284826a7 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -154,8 +154,8 @@ static void menudata_free(MenuData *md) * indicates a seperator, sss%l indicates a label and * new column. * - * @param str String to be parsed. - * @retval new menudata structure, free with menudata_free() + * \param str String to be parsed. + * \retval new menudata structure, free with menudata_free() */ static MenuData *decompose_menu_string(const char *str) { diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 3e7049b5b1e..805acff0a77 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -315,7 +315,7 @@ static const char *template_id_browse_tip(StructRNA *type) case ID_OB: return N_("Browse Object to be linked"); case ID_ME: return N_("Browse Mesh Data to be linked"); case ID_CU: return N_("Browse Curve Data to be linked"); - case ID_MB: return N_("Browse MetaBall Data to be linked"); + case ID_MB: return N_("Browse Metaball Data to be linked"); case ID_MA: return N_("Browse Material to be linked"); case ID_TE: return N_("Browse Texture to be linked"); case ID_IM: return N_("Browse Image to be linked"); @@ -793,7 +793,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, uiButSetFlag(but, UI_BUT_DISABLED); uiBlockSetEmboss(block, UI_EMBOSS); } - } /* tesselation point for curve-typed objects */ + } /* tessellation point for curve-typed objects */ else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { /* some modifiers could work with pre-tesselated curves only */ if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) { diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 4d2a1b69293..e8d4cba81c8 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -157,7 +157,7 @@ static void view2d_masks(View2D *v2d) /* Refresh and Validation */ -/* Initialise all relevant View2D data (including view rects if first time) and/or refresh mask sizes after view resize +/* Initialize all relevant View2D data (including view rects if first time) and/or refresh mask sizes after view resize * - for some of these presets, it is expected that the region will have defined some * additional settings necessary for the customisation of the 2D viewport to its requirements * - this function should only be called from region init() callbacks, where it is expected that @@ -168,7 +168,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) short tot_changed= 0, init= 0; uiStyle *style= UI_GetStyle(); - /* initialise data if there is a need for such */ + /* initialize data if there is a need for such */ if ((v2d->flag & V2D_IS_INITIALISED) == 0) { /* set initialised flag so that View2D doesn't get reinitialised next time again */ v2d->flag |= V2D_IS_INITIALISED; @@ -177,7 +177,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) /* see eView2D_CommonViewTypes in UI_view2d.h for available view presets */ switch (type) { - /* 'standard view' - optimum setup for 'standard' view behaviour, + /* 'standard view' - optimum setup for 'standard' view behavior, * that should be used new views as basis for their * own unique View2D settings, which should be used instead of this in most cases... */ @@ -588,7 +588,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) * * So, resolution is to just shift view by the gap between the extremities. * We favour moving the 'minimum' across, as that's origin for most things - * (XXX - in the past, max was favoured... if there are bugs, swap!) + * (XXX - in the past, max was favored... if there are bugs, swap!) */ if ((cur->xmin < tot->xmin) && (cur->xmax > tot->xmax)) { /* outside boundaries on both sides, so take middle-point of tot, and place in balanced way */ @@ -980,7 +980,7 @@ void UI_view2d_view_ortho(View2D *v2d) rctf curmasked; float xofs, yofs; - /* pixel offsets (-0.375f) are needed to get 1:1 correspondance with pixels for smooth UI drawing, + /* pixel offsets (-0.375f) are needed to get 1:1 correspondence with pixels for smooth UI drawing, * but only applied where requsted */ /* XXX brecht: instead of zero at least use a tiny offset, otherwise @@ -1019,7 +1019,7 @@ void UI_view2d_view_orthoSpecial(ARegion *ar, View2D *v2d, short xaxis) rctf curmasked; float xofs, yofs; - /* pixel offsets (-0.375f) are needed to get 1:1 correspondance with pixels for smooth UI drawing, + /* pixel offsets (-0.375f) are needed to get 1:1 correspondence with pixels for smooth UI drawing, * but only applied where requsted */ /* XXX temp (ton) */ @@ -1200,7 +1200,7 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag) /* vertical lines */ if (flag & V2D_VERTICAL_LINES) { - /* initialise initial settings */ + /* initialize initial settings */ vec1[0]= vec2[0]= grid->startx; vec1[1]= grid->starty; vec2[1]= v2d->cur.ymax; diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 234b2733bd3..6632cfc62ac 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -90,7 +90,7 @@ typedef struct v2dViewPanData { short in_scroller; /* for MMB in scrollers (old feature in past, but now not that useful) */ } v2dViewPanData; -/* initialise panning customdata */ +/* initialize panning customdata */ static int view_pan_init(bContext *C, wmOperator *op) { ARegion *ar= CTX_wm_region(C); @@ -315,7 +315,7 @@ static int view_scrollright_exec(bContext *C, wmOperator *op) { v2dViewPanData *vpd; - /* initialise default settings (and validate if ok to run) */ + /* initialize default settings (and validate if ok to run) */ if (!view_pan_init(C, op)) return OPERATOR_PASS_THROUGH; @@ -359,7 +359,7 @@ static int view_scrollleft_exec(bContext *C, wmOperator *op) { v2dViewPanData *vpd; - /* initialise default settings (and validate if ok to run) */ + /* initialize default settings (and validate if ok to run) */ if (!view_pan_init(C, op)) return OPERATOR_PASS_THROUGH; @@ -402,7 +402,7 @@ static int view_scrolldown_exec(bContext *C, wmOperator *op) { v2dViewPanData *vpd; - /* initialise default settings (and validate if ok to run) */ + /* initialize default settings (and validate if ok to run) */ if (!view_pan_init(C, op)) return OPERATOR_PASS_THROUGH; @@ -452,7 +452,7 @@ static int view_scrollup_exec(bContext *C, wmOperator *op) { v2dViewPanData *vpd; - /* initialise default settings (and validate if ok to run) */ + /* initialize default settings (and validate if ok to run) */ if (!view_pan_init(C, op)) return OPERATOR_PASS_THROUGH; @@ -527,7 +527,7 @@ typedef struct v2dViewZoomData { } v2dViewZoomData; -/* initialise panning customdata */ +/* initialize panning customdata */ static int view_zoomdrag_init(bContext *C, wmOperator *op) { ARegion *ar= CTX_wm_region(C); @@ -1286,7 +1286,7 @@ static short mouse_in_scroller_handle(int mouse, int sc_min, int sc_max, int sh_ return SCROLLHANDLE_BAR; } -/* initialise customdata for scroller manipulation operator */ +/* initialize customdata for scroller manipulation operator */ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event, short in_scroller) { v2dScrollerMove *vsm; @@ -1510,7 +1510,7 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event) if (in_scroller) { v2dScrollerMove *vsm; - /* initialise customdata */ + /* initialize customdata */ scroller_activate_init(C, op, event, in_scroller); vsm= (v2dScrollerMove *)op->customdata; diff --git a/source/blender/editors/mesh/bmesh_select.c b/source/blender/editors/mesh/bmesh_select.c index 43a598da28d..19802d7f667 100644 --- a/source/blender/editors/mesh/bmesh_select.c +++ b/source/blender/editors/mesh/bmesh_select.c @@ -104,7 +104,7 @@ void EDBM_automerge(Scene *scene, Object *obedit, int update) if ((scene->toolsettings->automerge) && (obedit && obedit->type == OB_MESH)) { - em = ((Mesh *)obedit->data)->edit_btmesh; + em = BMEdit_FromObject(obedit); if (!em) return; @@ -694,7 +694,7 @@ static EnumPropertyItem prop_similar_types[] = { static int similar_face_select_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMOperator bmop; /* get the type from RNA */ @@ -735,7 +735,7 @@ static int similar_face_select_exec(bContext *C, wmOperator *op) static int similar_edge_select_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMOperator bmop; /* get the type from RNA */ @@ -782,7 +782,7 @@ VERT GROUP static int similar_vert_select_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMOperator bmop; /* get the type from RNA */ int type = RNA_enum_get(op->ptr, "type"); @@ -835,7 +835,7 @@ static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *UNUS if (obedit && obedit->type == OB_MESH) { EnumPropertyItem *item = NULL; int a, totitem = 0; - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); if (em->selectmode & SCE_SELECT_VERTEX) { for (a = SIMVERT_NORMAL; a < SIMEDGE_LENGTH; a++) { @@ -910,7 +910,7 @@ static void walker_select(BMEditMesh *em, int walkercode, void *start, int selec static int loop_multiselect(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMEdge *eed; BMEdge **edarray; int edindex; @@ -1089,7 +1089,7 @@ void MESH_OT_loop_select(wmOperatorType *ot) RNA_def_boolean(ot->srna, "ring", 0, "Select Ring", "Select ring"); } -void MESH_OT_edgering_select (wmOperatorType *ot) +void MESH_OT_edgering_select(wmOperatorType *ot) { /* description */ ot->name = "Edge Ring Select"; @@ -1738,7 +1738,7 @@ static void linked_limit_default(bContext *C, wmOperator *op) { if (!RNA_struct_property_is_set(op->ptr, "limit")) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); if (em->selectmode == SCE_SELECT_FACE) RNA_boolean_set(op->ptr, "limit", TRUE); else @@ -1860,7 +1860,7 @@ void MESH_OT_select_linked_pick(wmOperatorType *ot) static int select_linked_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMesh *bm = em->bm; BMIter iter; BMVert *v; @@ -1904,7 +1904,7 @@ static int select_linked_exec(bContext *C, wmOperator *op) } else { BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { - if (BM_elem_flag_test(v, BM_ELEM_SELECT) && !BM_elem_flag_test(v, BM_ELEM_HIDDEN)) { + if (BM_elem_flag_test(v, BM_ELEM_SELECT)) { BM_elem_flag_enable(v, BM_ELEM_TAG); } else { @@ -1955,7 +1955,7 @@ void MESH_OT_select_linked(wmOperatorType *ot) static int select_more(bContext *C, wmOperator *UNUSED(op)) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); EDBM_select_more(em); @@ -1981,7 +1981,7 @@ void MESH_OT_select_more(wmOperatorType *ot) static int select_less(bContext *C, wmOperator *UNUSED(op)) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); EDBM_select_less(em); @@ -2155,7 +2155,7 @@ static int EM_deselect_nth(BMEditMesh *em, int nth, int offset) static int mesh_select_nth_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); int nth = RNA_int_get(op->ptr, "nth"); int offset = RNA_int_get(op->ptr, "offset"); @@ -2217,7 +2217,7 @@ static int select_sharp_edges_exec(bContext *C, wmOperator *op) * small enough, select the edge */ Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMIter iter; BMEdge *e; BMLoop *l1, *l2; @@ -2270,7 +2270,7 @@ void MESH_OT_edges_select_sharp(wmOperatorType *ot) static int select_linked_flat_faces_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMIter iter, liter, liter2; BMFace *f, **stack = NULL; BLI_array_declare(stack); @@ -2351,7 +2351,7 @@ void MESH_OT_faces_select_linked_flat(wmOperatorType *ot) static int select_non_manifold_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMVert *v; BMEdge *e; BMIter iter; @@ -2400,7 +2400,7 @@ void MESH_OT_select_non_manifold(wmOperatorType *ot) static int mesh_select_random_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMVert *eve; BMEdge *eed; BMFace *efa; @@ -2466,7 +2466,7 @@ void MESH_OT_select_random(wmOperatorType *ot) static int select_next_loop(bContext *C, wmOperator *UNUSED(op)) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *f; BMVert *v; BMIter iter; @@ -2480,7 +2480,7 @@ static int select_next_loop(bContext *C, wmOperator *UNUSED(op)) BMIter liter; BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, f) { - if (BM_elem_flag_test(l->v, BM_ELEM_SELECT) && !BM_elem_flag_test(l->v, BM_ELEM_HIDDEN)) { + if (BM_elem_flag_test(l->v, BM_ELEM_SELECT)) { BM_elem_flag_enable(l->next->v, BM_ELEM_TAG); BM_elem_select_set(em->bm, l->v, FALSE); } @@ -2516,7 +2516,7 @@ void MESH_OT_select_next_loop(wmOperatorType *ot) static int region_to_loop(bContext *C, wmOperator *UNUSED(op)) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *f; BMEdge *e; BMIter iter; @@ -2720,7 +2720,7 @@ static int loop_find_regions(BMEditMesh *em, int selbigger) static int loop_to_region(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMIter iter; BMFace *f; int selbigger = RNA_boolean_get(op->ptr, "select_bigger"); diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c index 7006434e89a..1d40f61bef5 100644 --- a/source/blender/editors/mesh/bmesh_tools.c +++ b/source/blender/editors/mesh/bmesh_tools.c @@ -77,7 +77,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) { ToolSettings *ts = CTX_data_tool_settings(C); Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); int cuts = RNA_int_get(op->ptr,"number_cuts"); float smooth = 0.292f * RNA_float_get(op->ptr, "smoothness"); float fractal = RNA_float_get(op->ptr, "fractal")/2.5; @@ -248,8 +248,7 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag, BMElem *ele; BMO_op_init(bm, &extop, "extrude_face_region"); - BMO_slot_from_hflag(bm, &extop, "edgefacein", - hflag, BM_VERT|BM_EDGE|BM_FACE); + BMO_slot_buffer_from_hflag(bm, &extop, "edgefacein", hflag, BM_VERT|BM_EDGE|BM_FACE); /* If a mirror modifier with clipping is on, we need to adjust some * of the cases above to handle edges on the line of symmetry. @@ -271,7 +270,10 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag, edge; edge = BM_iter_step(&iter)) { - if (BM_elem_flag_test(edge, hflag)) { + if (BM_elem_flag_test(edge, hflag) && + BM_edge_is_boundary(edge) && + BM_elem_flag_test(edge->l->f, hflag)) + { float co1[3], co2[3]; copy_v3_v3(co1, edge->v1->co); @@ -366,7 +368,7 @@ static short EDBM_Extrude_vert(Object *obedit, BMEditMesh *em, const char hflag, static int extrude_repeat_mesh(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); RegionView3D *rv3d = CTX_wm_region_view3d(C); int steps = RNA_int_get(op->ptr,"steps"); @@ -506,7 +508,7 @@ static int mesh_extrude_region_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); EDBM_Extrude_Mesh(scene, obedit, em, op, NULL); @@ -514,7 +516,7 @@ static int mesh_extrude_region_exec(bContext *C, wmOperator *op) * like this one don't push undo data until after modal mode is * done.*/ EDBM_RecalcNormals(em); - BMEdit_RecalcTesselation(em); + BMEdit_RecalcTessellation(em); WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit); @@ -541,7 +543,7 @@ void MESH_OT_extrude_region(wmOperatorType *ot) static int mesh_extrude_verts_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); float nor[3]; EDBM_Extrude_verts_indiv(em, op, BM_ELEM_SELECT, nor); @@ -571,7 +573,7 @@ void MESH_OT_extrude_verts_indiv(wmOperatorType *ot) static int mesh_extrude_edges_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); float nor[3]; EDBM_Extrude_edges_indiv(em, op, BM_ELEM_SELECT, nor); @@ -601,7 +603,7 @@ void MESH_OT_extrude_edges_indiv(wmOperatorType *ot) static int mesh_extrude_faces_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); float nor[3]; EDBM_Extrude_face_indiv(em, op, BM_ELEM_SELECT, nor); @@ -640,7 +642,7 @@ void EDBM_toggle_select_all(BMEditMesh *em) /* exported for UV */ static int mesh_select_all_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); int action = RNA_enum_get(op->ptr, "action"); switch (action) { @@ -683,7 +685,7 @@ void MESH_OT_select_all(wmOperatorType *ot) static int mesh_faces_select_interior_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); if (EDBM_select_interior_faces(em)) { WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit); @@ -874,7 +876,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) * like this one don't push undo data until after modal mode is * done. */ EDBM_RecalcNormals(vc.em); - BMEdit_RecalcTesselation(vc.em); + BMEdit_RecalcTessellation(vc.em); WM_event_add_notifier(C, NC_GEOM|ND_DATA, vc.obedit->data); DAG_id_tag_update(vc.obedit->data, OB_RECALC_DATA); @@ -901,7 +903,7 @@ void MESH_OT_dupli_extrude_cursor(wmOperatorType *ot) static int delete_mesh(bContext *C, Object *obedit, wmOperator *op, int event, Scene *UNUSED(scene)) { - BMEditMesh *bem = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *bem = BMEdit_FromObject(obedit); if (event < 1) return OPERATOR_CANCELLED; @@ -976,7 +978,7 @@ static EnumPropertyItem prop_mesh_delete_types[] = { static int delete_mesh_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); Scene *scene = CTX_data_scene(C); int type = RNA_enum_get(op->ptr, "type"); @@ -1025,7 +1027,7 @@ static int addedgeface_mesh_exec(bContext *C, wmOperator *op) { BMOperator bmop; Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); if (!EDBM_InitOpf(em, &bmop, op, "contextual_create geom=%hfev", BM_ELEM_SELECT)) return OPERATOR_CANCELLED; @@ -1064,7 +1066,7 @@ static int editbmesh_mark_seam(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); Mesh *me = ((Mesh *)obedit->data); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMesh *bm = em->bm; BMEdge *eed; BMIter iter; @@ -1118,7 +1120,7 @@ static int editbmesh_mark_sharp(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); Mesh *me = ((Mesh *)obedit->data); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMesh *bm = em->bm; BMEdge *eed; BMIter iter; @@ -1174,7 +1176,7 @@ void MESH_OT_mark_sharp(wmOperatorType *ot) static int editbmesh_vert_connect(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMesh *bm = em->bm; BMOperator bmop; int len = 0; @@ -1211,7 +1213,7 @@ void MESH_OT_vert_connect(wmOperatorType *ot) static int editbmesh_edge_split(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMesh *bm = em->bm; BMOperator bmop; int len = 0; @@ -1254,7 +1256,7 @@ void MESH_OT_edge_split(wmOperatorType *ot) static int mesh_duplicate_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMOperator bmop; EDBM_InitOpf(em, &bmop, op, "dupe geom=%hvef", BM_ELEM_SELECT); @@ -1303,7 +1305,7 @@ void MESH_OT_duplicate(wmOperatorType *ot) static int flip_normals(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); if (!EDBM_CallOpf(em, op, "reversefaces faces=%hf", BM_ELEM_SELECT)) return OPERATOR_CANCELLED; @@ -1338,7 +1340,7 @@ static const EnumPropertyItem direction_items[] = { static int edge_rotate_selected(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMOperator bmop; BMEdge *eed; BMIter iter; @@ -1370,7 +1372,7 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) if (!eed) { BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) { - if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) { + if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) { /* de-select the edge before */ do_deselect = TRUE; break; @@ -1456,7 +1458,7 @@ void EDBM_hide_mesh(BMEditMesh *em, int swap) static int hide_mesh_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); EDBM_hide_mesh(em, RNA_boolean_get(op->ptr, "unselected")); @@ -1530,7 +1532,7 @@ void EDBM_reveal_mesh(BMEditMesh *em) static int reveal_mesh_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); EDBM_reveal_mesh(em); @@ -1558,7 +1560,7 @@ void MESH_OT_reveal(wmOperatorType *ot) static int normals_make_consistent_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); /* doflip has to do with bmesh_rationalize_normals, it's an internal * thing */ @@ -1596,7 +1598,7 @@ void MESH_OT_normals_make_consistent(wmOperatorType *ot) static int do_smooth_vertex(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); ModifierData *md; int mirrx = FALSE, mirry = FALSE, mirrz = FALSE; int i, repeat; @@ -1675,7 +1677,7 @@ static int bm_test_exec(bContext *C, wmOperator *UNUSED(op)) Object *obedit = CTX_data_edit_object(C); ARegion *ar = CTX_wm_region(C); View3D *v3d = CTX_wm_view3d(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMBVHTree *tree = BMBVH_NewBVH(em, 0, NULL, NULL); BMIter iter; BMEdge *e; @@ -1763,7 +1765,7 @@ static void mesh_set_smooth_faces(BMEditMesh *em, short smooth) static int mesh_faces_shade_smooth_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); mesh_set_smooth_faces(em, 1); @@ -1791,7 +1793,7 @@ void MESH_OT_faces_shade_smooth(wmOperatorType *ot) static int mesh_faces_shade_flat_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); mesh_set_smooth_faces(em, 0); @@ -1828,7 +1830,7 @@ static const EnumPropertyItem axis_items[] = { static int mesh_rotate_uvs(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMOperator bmop; /* get the direction from RNA */ @@ -1856,7 +1858,7 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op) static int mesh_reverse_uvs(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMOperator bmop; /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */ @@ -1881,7 +1883,7 @@ static int mesh_reverse_uvs(bContext *C, wmOperator *op) static int mesh_rotate_colors(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMOperator bmop; /* get the direction from RNA */ @@ -1912,7 +1914,7 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op) static int mesh_reverse_colors(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMOperator bmop; /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */ @@ -2082,7 +2084,7 @@ static int merge_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); int status = 0, uvs = RNA_boolean_get(op->ptr, "uvs"); switch(RNA_enum_get(op->ptr, "type")) { @@ -2133,7 +2135,7 @@ static EnumPropertyItem *merge_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), obedit = CTX_data_edit_object(C); if (obedit && obedit->type == OB_MESH) { - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); if (em->selectmode & SCE_SELECT_VERTEX) { if (em->bm->selected.first && em->bm->selected.last && @@ -2188,7 +2190,7 @@ void MESH_OT_merge(wmOperatorType *ot) static int removedoublesflag_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMOperator bmop; int count; @@ -2252,7 +2254,7 @@ typedef struct PathEdge { static int select_vertex_path_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMOperator bmop; BMEditSelection *sv, *ev; @@ -2343,7 +2345,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) ARegion *ar = CTX_wm_region(C); View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = CTX_wm_region_view3d(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMesh *bm = em->bm; BMOperator bmop; BMBVHTree *bvhtree; @@ -2729,7 +2731,7 @@ void MESH_OT_blend_from_shape(wmOperatorType *ot) static int select_axis_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMEditSelection *ese = em->bm->selected.last; int axis = RNA_enum_get(op->ptr, "axis"); int mode = RNA_enum_get(op->ptr, "mode"); /* -1 == aligned, 0 == neg, 1 == pos */ @@ -3066,7 +3068,7 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode, static int knife_cut_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMesh *bm = em->bm; ARegion *ar = CTX_wm_region(C); BMVert *bv; @@ -3140,7 +3142,7 @@ static int knife_cut_exec(bContext *C, wmOperator *op) } } - BMO_slot_from_flag(bm, &bmop, "edges", 1, BM_EDGE); + BMO_slot_buffer_from_flag(bm, &bmop, "edges", 1, BM_EDGE); if (mode == KNIFE_MIDPOINT) numcuts = 1; BMO_slot_int_set(&bmop, "numcuts", numcuts); @@ -3199,28 +3201,28 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO Object *obedit = editbase->object; Mesh *me = obedit->data; BMEditMesh *em = me->edit_btmesh; - BMesh *bmnew; + BMesh *bm_new; if (!em) return OPERATOR_CANCELLED; - bmnew = BM_mesh_create(obedit, bm_mesh_allocsize_default); - CustomData_copy(&em->bm->vdata, &bmnew->vdata, CD_MASK_BMESH, CD_CALLOC, 0); - CustomData_copy(&em->bm->edata, &bmnew->edata, CD_MASK_BMESH, CD_CALLOC, 0); - CustomData_copy(&em->bm->ldata, &bmnew->ldata, CD_MASK_BMESH, CD_CALLOC, 0); - CustomData_copy(&em->bm->pdata, &bmnew->pdata, CD_MASK_BMESH, CD_CALLOC, 0); - - CustomData_bmesh_init_pool(&bmnew->vdata, bm_mesh_allocsize_default[0]); - CustomData_bmesh_init_pool(&bmnew->edata, bm_mesh_allocsize_default[1]); - CustomData_bmesh_init_pool(&bmnew->ldata, bm_mesh_allocsize_default[2]); - CustomData_bmesh_init_pool(&bmnew->pdata, bm_mesh_allocsize_default[3]); + bm_new = BM_mesh_create(obedit, &bm_mesh_allocsize_default); + CustomData_copy(&em->bm->vdata, &bm_new->vdata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&em->bm->edata, &bm_new->edata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&em->bm->ldata, &bm_new->ldata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&em->bm->pdata, &bm_new->pdata, CD_MASK_BMESH, CD_CALLOC, 0); + + CustomData_bmesh_init_pool(&bm_new->vdata, bm_mesh_allocsize_default.totvert, BM_VERT); + CustomData_bmesh_init_pool(&bm_new->edata, bm_mesh_allocsize_default.totedge, BM_EDGE); + CustomData_bmesh_init_pool(&bm_new->ldata, bm_mesh_allocsize_default.totloop, BM_LOOP); + CustomData_bmesh_init_pool(&bm_new->pdata, bm_mesh_allocsize_default.totface, BM_FACE); basenew = ED_object_add_duplicate(bmain, scene, editbase, USER_DUP_MESH); /* 0 = fully linked */ assign_matarar(basenew->object, give_matarar(obedit), *give_totcolp(obedit)); /* new in 2.5 */ ED_base_object_select(basenew, BA_DESELECT); - EDBM_CallOpf(em, wmop, "dupe geom=%hvef dest=%p", BM_ELEM_SELECT, bmnew); + EDBM_CallOpf(em, wmop, "dupe geom=%hvef dest=%p", BM_ELEM_SELECT, bm_new); EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_FACES); /* clean up any loose edges */ @@ -3246,11 +3248,11 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_VERTS); - BM_mesh_normals_update(bmnew, TRUE); - BMO_op_callf(bmnew, "bmesh_to_mesh mesh=%p object=%p notesselation=%b", + BM_mesh_normals_update(bm_new, TRUE); + BMO_op_callf(bm_new, "bmesh_to_mesh mesh=%p object=%p notessellation=%b", basenew->object->data, basenew->object, TRUE); - BM_mesh_free(bmnew); + BM_mesh_free(bm_new); ((Mesh *)basenew->object->data)->edit_btmesh = NULL; return 1; @@ -3346,7 +3348,7 @@ static int mesh_separate_exec(bContext *C, wmOperator *op) if (type == 0) retval = mesh_separate_selected(bmain, scene, base, op); else if (type == 1) - retval = mesh_separate_material (bmain, scene, base, op); + retval = mesh_separate_material(bmain, scene, base, op); else if (type == 2) retval = mesh_separate_loose(bmain, scene, base, op); @@ -3390,7 +3392,7 @@ void MESH_OT_separate(wmOperatorType *ot) static int fill_mesh_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMOperator bmop; if (!EDBM_InitOpf(em, &bmop, op, "triangle_fill edges=%he", BM_ELEM_SELECT)) { @@ -3430,7 +3432,7 @@ void MESH_OT_fill(wmOperatorType *ot) static int beautify_fill_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); if (!EDBM_CallOpf(em, op, "beautify_fill faces=%hf", BM_ELEM_SELECT)) return OPERATOR_CANCELLED; @@ -3460,7 +3462,7 @@ void MESH_OT_beautify_fill(wmOperatorType *ot) static int quads_convert_to_tris_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); if (!EDBM_CallOpf(em, op, "triangulate faces=%hf", BM_ELEM_SELECT)) return OPERATOR_CANCELLED; @@ -3488,7 +3490,7 @@ void MESH_OT_quads_convert_to_tris(wmOperatorType *ot) static int tris_convert_to_quads_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); int dosharp, douvs, dovcols, domaterials; float limit = RNA_float_get(op->ptr, "limit"); @@ -3538,7 +3540,7 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot) static int dissolve_limited_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); float angle_limit = RNA_float_get(op->ptr, "angle_limit"); if (!EDBM_CallOpf(em, op, @@ -3578,7 +3580,7 @@ void MESH_OT_dissolve_limited(wmOperatorType *ot) static int split_mesh_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMOperator bmop; EDBM_InitOpf(em, &bmop, op, "split geom=%hvef use_only_faces=%b", BM_ELEM_SELECT, FALSE); @@ -3590,7 +3592,7 @@ static int split_mesh_exec(bContext *C, wmOperator *op) } /* Geometry has changed, need to recalc normals and looptris */ - BMEdit_RecalcTesselation(em); + BMEdit_RecalcTessellation(em); EDBM_RecalcNormals(em); DAG_id_tag_update(ob->data, OB_RECALC_DATA); @@ -3618,7 +3620,7 @@ static int spin_mesh_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); ToolSettings *ts = CTX_data_tool_settings(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMesh *bm = em->bm; BMOperator spinop; float cent[3], axis[3], imat[3][3]; @@ -3698,7 +3700,7 @@ void MESH_OT_spin(wmOperatorType *ot) static int screw_mesh_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMesh *bm = em->bm; BMEdge *eed; BMVert *eve, *v1, *v2; @@ -3824,7 +3826,7 @@ void MESH_OT_screw(wmOperatorType *ot) static int select_by_number_vertices_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMIter iter; int numverts = RNA_int_get(op->ptr, "number"); @@ -3883,7 +3885,7 @@ void MESH_OT_select_by_number_vertices(wmOperatorType *ot) static int select_loose_verts_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMVert *eve; BMEdge *eed; BMIter iter; @@ -3928,7 +3930,7 @@ void MESH_OT_select_loose_verts(wmOperatorType *ot) static int select_mirror_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); int extend = RNA_boolean_get(op->ptr, "extend"); EDBM_select_mirrored(obedit, em, extend); @@ -4316,7 +4318,7 @@ static void hashvert_flag(EditMesh *em, int flag) static int mesh_vertices_randomize_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); #if 1 /* BMESH TODO */ (void)em; #else @@ -4347,27 +4349,29 @@ void MESH_OT_vertices_randomize(wmOperatorType *ot) static int mesh_noise_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); Material *ma; Tex *tex; BMVert *eve; BMIter iter; float fac = RNA_float_get(op->ptr, "factor"); - if (em == NULL) return OPERATOR_FINISHED; + if (em == NULL) { + return OPERATOR_FINISHED; + } - ma = give_current_material(obedit, obedit->actcol); - if (ma == 0 || ma->mtex[0] == 0 || ma->mtex[0]->tex == 0) { + if ((ma = give_current_material(obedit, obedit->actcol)) == NULL || + (tex = give_current_material_texture(ma)) == NULL) + { BKE_report(op->reports, RPT_WARNING, "Mesh has no material or texture assigned"); return OPERATOR_FINISHED; } - tex = give_current_material_texture(ma); if (tex->type == TEX_STUCCI) { float b2, vec[3]; float ofs = tex->turbul / 200.0; BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { - if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && !BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) { + if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) { b2 = BLI_hnoise(tex->noisesize, eve->co[0], eve->co[1], eve->co[2]); if (tex->stype) ofs *= (b2 * b2); vec[0] = fac * (b2 - BLI_hnoise(tex->noisesize, eve->co[0] + ofs, eve->co[1], eve->co[2])); @@ -4380,7 +4384,7 @@ static int mesh_noise_exec(bContext *C, wmOperator *op) } else { BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { - if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && !BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) { + if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) { float tin, dum; externtex(ma->mtex[0], eve->co, &tin, &dum, &dum, &dum, &dum, 0); eve->co[2] += fac * tin; @@ -4417,7 +4421,7 @@ void MESH_OT_noise(wmOperatorType *ot) static int mesh_bevel_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMIter iter; BMEdge *eed; BMOperator bmop; @@ -4511,7 +4515,7 @@ void MESH_OT_bevel(wmOperatorType *ot) static int bridge_edge_loops(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); if (!EDBM_CallOpf(em, op, "bridge_loops edges=%he", BM_ELEM_SELECT)) return OPERATOR_CANCELLED; diff --git a/source/blender/editors/mesh/bmesh_utils.c b/source/blender/editors/mesh/bmesh_utils.c index e5c79150dab..0f9bc29a16d 100644 --- a/source/blender/editors/mesh/bmesh_utils.c +++ b/source/blender/editors/mesh/bmesh_utils.c @@ -73,7 +73,7 @@ void EDBM_ClearMesh(BMEditMesh *em) em->derivedCage = em->derivedFinal = NULL; - /* free tesselation data */ + /* free tessellation data */ em->tottri = 0; if (em->looptris) MEM_freeN(em->looptris); @@ -143,7 +143,7 @@ int EDBM_FinishOp(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int re BMEdit_Free(em); *em = *emcopy; - BMEdit_RecalcTesselation(em); + BMEdit_RecalcTessellation(em); MEM_freeN(emcopy); em->emcopyusers = 0; @@ -245,7 +245,7 @@ void EDBM_selectmode_to_scene(bContext *C) { Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); if (!em) return; @@ -521,13 +521,13 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata) #ifdef BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND - /* we recalc the tesselation here, to avoid seeding calls to - * BMEdit_RecalcTesselation throughout the code. */ - BMEdit_RecalcTesselation(em); + /* we recalc the tessellation here, to avoid seeding calls to + * BMEdit_RecalcTessellation throughout the code. */ + BMEdit_RecalcTessellation(em); #endif - BMO_op_callf(em->bm, "bmesh_to_mesh mesh=%p notesselation=%b", &um->me, TRUE); + BMO_op_callf(em->bm, "bmesh_to_mesh mesh=%p notessellation=%b", &um->me, TRUE); um->selectmode = em->selectmode; return um; @@ -546,7 +546,7 @@ static void undoMesh_to_editbtMesh(void *umv, void *emv, void *UNUSED(obdata)) BMEdit_Free(em); - bm = BM_mesh_create(ob, bm_mesh_allocsize_default); + bm = BM_mesh_create(ob, &bm_mesh_allocsize_default); BMO_op_callf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%b", &um->me, ob, FALSE); em2 = BMEdit_Create(bm, TRUE); diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index f13f15a2cc3..1794e5d6e21 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -379,7 +379,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op) make_prim_finish(C, &state, enter_editmode); - return OPERATOR_FINISHED; + return OPERATOR_FINISHED; } void MESH_OT_primitive_cone_add(wmOperatorType *ot) @@ -388,7 +388,7 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot) /* identifiers */ ot->name= "Add Cone"; - ot->description= "Construct a conic mesh (ends filled)"; + ot->description= "Construct a conic mesh"; ot->idname= "MESH_OT_primitive_cone_add"; /* api callbacks */ diff --git a/source/blender/editors/mesh/editmesh_bvh.c b/source/blender/editors/mesh/editmesh_bvh.c index cc1f89e2c8b..fc7818183bb 100644 --- a/source/blender/editors/mesh/editmesh_bvh.c +++ b/source/blender/editors/mesh/editmesh_bvh.c @@ -90,7 +90,7 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit) so that e.g. mirror or array use original vertex coordiantes and not mirrored or duplicate*/ BLI_smallhash_init(&shash); - BMEdit_RecalcTesselation(em); + BMEdit_RecalcTessellation(em); tree->ob = obedit; tree->scene = scene; diff --git a/source/blender/editors/mesh/knifetool.c b/source/blender/editors/mesh/knifetool.c index fe1cc18086f..3b78ceada98 100644 --- a/source/blender/editors/mesh/knifetool.c +++ b/source/blender/editors/mesh/knifetool.c @@ -29,13 +29,13 @@ #include "MEM_guardedalloc.h" - #include "BLI_blenlib.h" #include "BLI_array.h" #include "BLI_math.h" #include "BLI_rand.h" #include "BLI_smallhash.h" #include "BLI_scanfill.h" +#include "BLI_memarena.h" #include "BKE_DerivedMesh.h" #include "BKE_context.h" @@ -1678,7 +1678,7 @@ static void remerge_faces(knifetool_opdata *kcd) } } } - /* BMESH_TODO, check if the code above validates the indicies */ + /* BMESH_TODO, check if the code above validates the indices */ /* bm->elem_index_dirty &= ~BM_FACE; */ bm->elem_index_dirty |= BM_FACE; @@ -1721,7 +1721,7 @@ static void knifenet_fill_faces(knifetool_opdata *kcd) BMO_elem_flag_enable(bm, e, BOUNDARY); } - /* turn knife verts into real verts, as necassary */ + /* turn knife verts into real verts, as necessary */ BLI_mempool_iternew(kcd->kverts, &iter); for (kfv = BLI_mempool_iterstep(&iter); kfv; kfv = BLI_mempool_iterstep(&iter)) { if (!kfv->v) { @@ -2051,7 +2051,7 @@ static int knifetool_init(bContext *C, wmOperator *op, int UNUSED(do_cut)) kcd->draw_handle = ED_region_draw_cb_activate(kcd->ar->type, knifetool_draw, kcd, REGION_DRAW_POST_VIEW); em_setup_viewcontext(C, &kcd->vc); - kcd->em = ((Mesh *)kcd->ob->data)->edit_btmesh; + kcd->em = BMEdit_FromObject(kcd->ob); BM_mesh_elem_index_ensure(kcd->em->bm, BM_VERT); @@ -2076,9 +2076,9 @@ static int knifetool_init(bContext *C, wmOperator *op, int UNUSED(do_cut)) ED_region_tag_redraw(kcd->ar); - kcd->refs = BLI_mempool_create(sizeof(Ref), 1, 2048, FALSE, FALSE); - kcd->kverts = BLI_mempool_create(sizeof(KnifeVert), 1, 512, FALSE, TRUE); - kcd->kedges = BLI_mempool_create(sizeof(KnifeEdge), 1, 512, FALSE, TRUE); + kcd->refs = BLI_mempool_create(sizeof(Ref), 1, 2048, 0); + kcd->kverts = BLI_mempool_create(sizeof(KnifeVert), 1, 512, BLI_MEMPOOL_ALLOW_ITER); + kcd->kedges = BLI_mempool_create(sizeof(KnifeEdge), 1, 512, BLI_MEMPOOL_ALLOW_ITER); kcd->origedgemap = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "knife origedgemap"); kcd->origvertmap = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "knife origvertmap"); @@ -2185,7 +2185,7 @@ static int knifetool_modal (bContext *C, wmOperator *op, wmEvent *event) } obedit = CTX_data_edit_object(C); - if (!obedit || obedit->type != OB_MESH || ((Mesh *)obedit->data)->edit_btmesh != kcd->em) { + if (!obedit || obedit->type != OB_MESH || BMEdit_FromObject(obedit) != kcd->em) { knifetool_exit(C, op); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index 30dedf10618..a82310be926 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -373,7 +373,7 @@ static int ringsel_init (bContext *C, wmOperator *op, int do_cut) lcd->ar= CTX_wm_region(C); lcd->draw_handle= ED_region_draw_cb_activate(lcd->ar->type, ringsel_draw, lcd, REGION_DRAW_POST_VIEW); lcd->ob = CTX_data_edit_object(C); - lcd->em= ((Mesh *)lcd->ob->data)->edit_btmesh; + lcd->em = BMEdit_FromObject(lcd->ob); lcd->extend = do_cut ? 0 : RNA_boolean_get(op->ptr, "extend"); lcd->do_cut = do_cut; diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 2be66ca5310..4259f7fc558 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -100,7 +100,7 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la layer data pointer to find where the active layer has ended up. - this is necassary because the deletion functions only support deleting the active + this is necessary because the deletion functions only support deleting the active layer. */ actlayerdata = data->layers[CustomData_get_active_layer_index(data, type)].data; rndlayerdata = data->layers[CustomData_get_render_layer_index(data, type)].data; @@ -751,19 +751,24 @@ void MESH_OT_sticky_remove(wmOperatorType *ot) /************************** Add Geometry Layers *************************/ -void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges) +void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface) { int *polyindex = NULL; float (*face_nors)[3]; - if(mesh->totface > 0 && mesh->totpoly == 0) + if(mesh->totface > 0 && mesh->totpoly == 0) { convert_mfaces_to_mpolys(mesh); + /* would only be converting back again, dont bother */ + calc_tessface = FALSE; + } + if(calc_edges || (mesh->totpoly && mesh->totedge == 0)) BKE_mesh_calc_edges(mesh, calc_edges); - /* TODO, make this optional, we dont always want this! */ - BKE_mesh_tessface_calc(mesh); + if (calc_tessface) { + BKE_mesh_tessface_calc(mesh); + } polyindex = CustomData_get_layer(&mesh->fdata, CD_POLYINDEX); /* add a normals layer for tesselated faces, a tessface normal will diff --git a/source/blender/editors/mesh/mesh_navmesh.c b/source/blender/editors/mesh/mesh_navmesh.c index 374fbca0659..38d632ffaee 100644 --- a/source/blender/editors/mesh/mesh_navmesh.c +++ b/source/blender/editors/mesh/mesh_navmesh.c @@ -321,7 +321,7 @@ static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh, } ED_object_enter_editmode(C, EM_DO_UNDO|EM_IGNORE_LAYER); - em= (((Mesh *)obedit->data))->edit_btmesh; + em = BMEdit_FromObject(obedit); if(!createob) { /* clear */ @@ -483,8 +483,8 @@ void MESH_OT_navmesh_make(wmOperatorType *ot) static int navmesh_face_copy_exec(bContext *C, wmOperator *op) { - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh; + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); /* do work here */ BMFace *efa_act= BM_active_face_get(em->bm, FALSE); @@ -571,8 +571,8 @@ static int findFreeNavPolyIndex(BMEditMesh* em) static int navmesh_face_add_exec(bContext *C, wmOperator *UNUSED(op)) { - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh; + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *ef; BMIter iter; diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 1f2918e8504..08cd3d7cd94 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -176,7 +176,7 @@ static int ED_operator_editmesh_face_select(bContext *C) { Object *obedit= CTX_data_edit_object(C); if(obedit && obedit->type==OB_MESH) { - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); if (em && em->selectmode & SCE_SELECT_FACE) { return 1; } diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index bad0718c613..7bf41bdce00 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -594,7 +594,7 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op) key= me->key= add_key((ID *)me); key->type= KEY_RELATIVE; - /* first key added, so it was the basis. initialise it with the existing mesh */ + /* first key added, so it was the basis. initialize it with the existing mesh */ kb= add_keyblock(key, NULL); mesh_to_key(me, kb); } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 27ed9f5b46e..29526825736 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1372,7 +1372,7 @@ static int convert_exec(bContext *C, wmOperator *op) DM_to_mesh(dm, newob->data, newob); - /* re-tesselation is called by DM_to_mesh */ + /* re-tessellation is called by DM_to_mesh */ dm->release(dm); object_free_modifiers(newob); /* after derivedmesh calls! */ diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 55dbbb50958..c5d81969098 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -478,7 +478,7 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M key= me->key= add_key((ID *)me); key->type= KEY_RELATIVE; /* if that was the first key block added, then it was the basis. - * Initialise it with the mesh, and add another for the modifier */ + * Initialize it with the mesh, and add another for the modifier */ kb= add_keyblock(key, NULL); mesh_to_key(me, kb); } @@ -1655,7 +1655,7 @@ static int ocean_bake_exec(bContext *C, wmOperator *op) for (f=omd->bakestart; f<=omd->bakeend; f++) { /* from physics_fluid.c: - * XXX: This can't be used due to an anim sys optimisation that ignores recalc object animation, + * XXX: This can't be used due to an anim sys optimization that ignores recalc object animation, * leaving it for the depgraph (this ignores object animation such as modifier properties though... :/ ) * --> BKE_animsys_evaluate_all_animation(G.main, eval_time); * This doesn't work with drivers: diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 1e075fd4d43..2281d7a26d8 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -544,7 +544,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object bAction *act = verify_adt_action(&cu->id, 1); FCurve *fcu = verify_fcurve(act, NULL, "eval_time", 0, 1); - /* setup dummy 'generator' modifier here to get 1-1 correspondance still working */ + /* setup dummy 'generator' modifier here to get 1-1 correspondence still working */ if (!fcu->bezt && !fcu->fpt && !fcu->modifiers.first) add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_GENERATOR); } diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index c60041fe67b..f610d758243 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -92,7 +92,7 @@ static Lattice *vgroup_edit_lattice(Object *ob) int ED_vgroup_object_is_edit_mode(Object *ob) { if(ob->type == OB_MESH) - return (((Mesh*)ob->data)->edit_btmesh != NULL); + return (BMEdit_FromObject(ob) != NULL); else if(ob->type == OB_LATTICE) return (((Lattice*)ob->data)->editlatt != NULL); @@ -769,7 +769,7 @@ static int* getSurroundingVerts(Mesh *me, int vert, int *count) MLoop *ml = &me->mloop[mp->loopstart]; while(j--) { /* XXX This assume a vert can only be once in a poly, even though - * it seems logical to me, not totaly sure of that. */ + * it seems logical to me, not totally sure of that. */ if (ml->v == vert) { int a, b, k; if(j == first_l) { @@ -1257,11 +1257,12 @@ static void vgroup_blend(Object *ob) int i, dvert_tot=0; const int def_nr= ob->actdef-1; - BMEditMesh *em= ((Mesh *)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); // ED_vgroup_give_array(ob->data, &dvert_array, &dvert_tot); - if (em==NULL) + if (em == NULL) { return; + } if (BLI_findlink(&ob->defbase, def_nr)) { BMEdge *eed; @@ -1604,7 +1605,7 @@ void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_v } /* unlike editmesh we know that by only looping over the first hald of - * the 'u' indicies it will cover all points except the middle which is + * the 'u' indices it will cover all points except the middle which is * ok in this case */ pntsu_half= lt->pntsu / 2; @@ -1880,7 +1881,7 @@ static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *dg) static int vgroup_object_in_edit_mode(Object *ob) { if(ob->type == OB_MESH) - return (((Mesh*)ob->data)->edit_btmesh != NULL); + return (BMEdit_FromObject(ob) != NULL); else if(ob->type == OB_LATTICE) return (((Lattice*)ob->data)->editlatt != NULL); @@ -2644,7 +2645,7 @@ static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op) if((change == 0 && fail == 0) || fail) { BKE_reportf(op->reports, RPT_ERROR, - "Copy to VGroups to Selected warning done %d, failed %d, object data must have matching indicies", + "Copy to VGroups to Selected warning done %d, failed %d, object data must have matching indices", change, fail); } @@ -2773,7 +2774,7 @@ static int vgroup_do_remap(Object *ob, char *name_array, wmOperator *op) if(ob->mode == OB_MODE_EDIT) { if(ob->type==OB_MESH) { - BMEditMesh *em = ((Mesh*)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMIter iter; BMVert *eve; @@ -2795,7 +2796,7 @@ static int vgroup_do_remap(Object *ob, char *name_array, wmOperator *op) ED_vgroup_give_array(ob->data, &dvert, &dvert_tot); - /*create as necassary*/ + /*create as necessary*/ while(dvert && dvert_tot--) { if(dvert->totweight) defvert_remap(dvert, sort_map, defbase_tot); diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c index cdcaae91070..7f568833866 100644 --- a/source/blender/editors/physics/dynamicpaint_ops.c +++ b/source/blender/editors/physics/dynamicpaint_ops.c @@ -48,7 +48,6 @@ #include "RNA_define.h" #include "RNA_enum_types.h" -/* Platform independend time */ #include "PIL_time.h" #include "WM_types.h" @@ -169,7 +168,7 @@ static int type_toggle_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - /* update dependancy */ + /* update dependency */ DAG_id_tag_update(&cObject->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, cObject); DAG_scene_sort(CTX_data_main(C), scene); diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 5648bc69099..2a7f9b2a626 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -952,7 +952,7 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit) } } } -/* force set distances between neighbouring keys */ +/* force set distances between neighboring keys */ static void PE_apply_lengths(Scene *scene, PTCacheEdit *edit) { @@ -977,7 +977,7 @@ static void PE_apply_lengths(Scene *scene, PTCacheEdit *edit) } } } -/* try to find a nice solution to keep distances between neighbouring keys */ +/* try to find a nice solution to keep distances between neighboring keys */ static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit) { ParticleEditSettings *pset=PE_settings(scene); @@ -2196,7 +2196,7 @@ static void remove_tagged_keys(Object *ob, ParticleSystem *psys) /************************ subdivide opertor *********************/ -/* works like normal edit mode subdivide, inserts keys between neighbouring selected keys */ +/* works like normal edit mode subdivide, inserts keys between neighboring selected keys */ static void subdivide_particle(PEData *data, int pa_index) { PTCacheEdit *edit= data->edit; diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index e8ada1e0655..d3af007d2e6 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -423,7 +423,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid eval_time = domainSettings->bakeStart + i; - /* XXX: This can't be used due to an anim sys optimisation that ignores recalc object animation, + /* XXX: This can't be used due to an anim sys optimization that ignores recalc object animation, * leaving it for the depgraph (this ignores object animation such as modifier properties though... :/ ) * --> BKE_animsys_evaluate_all_animation(G.main, eval_time); * This doesn't work with drivers: @@ -975,7 +975,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor channels->length = scene->r.efra; channels->aniFrameTime = (domainSettings->animEnd - domainSettings->animStart)/(double)noFrames; - /* ******** initialise and allocate animation channels ******** */ + /* ******** initialize and allocate animation channels ******** */ fluid_init_all_channels(C, fsDomain, domainSettings, channels, fobjects); /* reset to original current frame */ diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index e35df217761..d018a8d03d3 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -119,7 +119,7 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat if(xmax < 1 || ymax < 1) return; - /* find current float rect for display, first case is after composit... still weak */ + /* find current float rect for display, first case is after composite... still weak */ if(rr->rectf) rectf= rr->rectf; else { diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index d7a9d96830b..7d7063b621c 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -169,7 +169,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op)) if(ob && ob->actcol>0) { if(ob->type == OB_MESH) { - BMEditMesh *em= ((Mesh*)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); BMFace *efa; BMIter iter; @@ -224,13 +224,13 @@ void OBJECT_OT_material_slot_assign(wmOperatorType *ot) static int material_slot_de_select(bContext *C, int select) { - Object *ob= ED_object_context(C); + Object *ob = ED_object_context(C); if(!ob) return OPERATOR_CANCELLED; if(ob->type == OB_MESH) { - BMEditMesh *em= ((Mesh*)ob->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(ob); if(em) { EDBM_deselect_by_material(em, ob->actcol-1, select); diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 235c5da08c3..918df2f90e0 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -410,7 +410,7 @@ void glaRasterPosSafe2f(float x, float y, float known_good_x, float known_good_y GLubyte dummy= 0; /* As long as known good coordinates are correct - * this is guarenteed to generate an ok raster + * this is guaranteed to generate an ok raster * position (ignoring potential (real) overflow * issues). */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 039b1c2f866..8818bd66b23 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -315,7 +315,7 @@ int ED_operator_editmesh(bContext *C) { Object *obedit= CTX_data_edit_object(C); if(obedit && obedit->type==OB_MESH) - return NULL != ((Mesh *)obedit->data)->edit_btmesh; + return NULL != BMEdit_FromObject(obedit); return 0; } @@ -367,17 +367,18 @@ int ED_operator_uvedit(bContext *C) int ED_operator_uvmap(bContext *C) { - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= NULL; + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = NULL; - if(obedit && obedit->type==OB_MESH) - em= ((Mesh *)obedit->data)->edit_btmesh; + if(obedit && obedit->type == OB_MESH) { + em = BMEdit_FromObject(obedit); + } if(em && (em->bm->totface)) { - return 1; + return TRUE; } - return 0; + return FALSE; } int ED_operator_editsurfcurve(bContext *C) diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 6f1da1895e9..63e976693e3 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -1850,9 +1850,11 @@ static int project_bucket_isect_circle(const float cent[2], const float radius_s /* Note for rect_to_uvspace_ortho() and rect_to_uvspace_persp() * in ortho view this function gives good results when bucket_bounds are outside the triangle - * however in some cases, perspective view will mess up with faces that have minimal screenspace area (viewed from the side) + * however in some cases, perspective view will mess up with faces that have minimal screenspace area + * (viewed from the side) * - * for this reason its not relyable in this case so we'll use the Simple Barycentric' funcs that only account for points inside the triangle. + * for this reason its not reliable in this case so we'll use the Simple Barycentric' + * funcs that only account for points inside the triangle. * however switching back to this for ortho is always an option */ static void rect_to_uvspace_ortho( @@ -2434,7 +2436,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i if (is_ortho) screen_px_from_ortho(uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo, w); else screen_px_from_persp(uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo, w); - /* a pitty we need to get the worldspace pixel location here */ + /* a pity we need to get the worldspace pixel location here */ if(do_clip) { interp_v3_v3v3v3(wco, ps->dm_mvert[ (*(&mf->v1 + i1)) ].co, ps->dm_mvert[ (*(&mf->v1 + i2)) ].co, ps->dm_mvert[ (*(&mf->v1 + i3)) ].co, w); if (ED_view3d_clipping_test(ps->rv3d, wco, TRUE)) { @@ -2655,7 +2657,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i #endif } - /* a pitty we need to get the worldspace pixel location here */ + /* a pity we need to get the worldspace pixel location here */ if(do_clip) { if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w); else interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w); @@ -2731,7 +2733,7 @@ static void project_bucket_bounds(const ProjPaintState *ps, const int bucket_x, /* Fill this bucket with pixels from the faces that intersect it. * - * have bucket_bounds as an argument so we don;t need to give bucket_x/y the rect function needs */ + * have bucket_bounds as an argument so we don't need to give bucket_x/y the rect function needs */ static void project_bucket_init(const ProjPaintState *ps, const int thread_index, const int bucket_index, rctf *bucket_bounds) { LinkNode *node; @@ -4659,7 +4661,7 @@ static int uv_sculpt_brush_poll(bContext *C) if(!uv_sculpt_brush(C) || !obedit || obedit->type != OB_MESH) return 0; - em = ((Mesh *)obedit->data)->edit_btmesh; + em = BMEdit_FromObject(obedit); ret = EDBM_texFaceCheck(em); if(ret && sima) { diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index ad5aeea1b18..1937cb7b05c 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -2837,8 +2837,8 @@ static void vpaint_paint_poly(VPaint *vp, VPaintData *vpd, Object *ob, #endif #define CPYCOL(c, l) (c)->a = (l)->a, (c)->r = (l)->r, (c)->g = (l)->g, (c)->b = (l)->b - /* update vertex colors for tesselations incrementally, - * rather then regenerating the tesselation altogether */ + /* update vertex colors for tessellations incrementally, + * rather then regenerating the tessellation altogether */ for (e = vpd->polyfacemap[index].first; e; e = e->next) { mf = me->mface + e->facenr; mc = me->mcol + e->facenr*4; diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index 9bdb151d55d..f0aedae88ac 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -299,7 +299,7 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event, float co[2], radius, radius_root; Scene *scene = CTX_data_scene(C); ARegion *ar = CTX_wm_region(C); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); unsigned int tool; UvSculptData *sculptdata = (UvSculptData *)op->customdata; SpaceImage *sima; @@ -471,7 +471,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent Object *obedit = CTX_data_edit_object(C); ToolSettings *ts = scene->toolsettings; UvSculptData *data = MEM_callocN(sizeof(*data), "UV Smooth Brush Data"); - BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMesh *bm = em->bm; op->customdata = data; diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 3f3369ac6cb..4f145a617f7 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -299,7 +299,7 @@ static void SOUND_OT_bake_animation(wmOperatorType *ot) { /* identifiers */ ot->name= "Update animation cache"; - ot->description= "Updates the audio animation cache so that it's up to date"; + ot->description= "Update the audio animation cache"; ot->idname= "SOUND_OT_bake_animation"; /* api callbacks */ diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 309b455e2a2..f29dba4c568 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -300,7 +300,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) /* Draw keyframes * 1) Only channels that are visible in the Action Editor get drawn/evaluated. - * This is to try to optimise this for heavier data sets + * This is to try to optimize this for heavier data sets * 2) Keyframes which are out of view horizontally are disregarded */ y= (float)(-ACHANNEL_HEIGHT); diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 414999b2f2b..1b0b305b7aa 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -146,7 +146,7 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op) if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; - /* 'standard' behaviour - check if selected, then apply relevant selection */ + /* 'standard' behavior - check if selected, then apply relevant selection */ if (RNA_boolean_get(op->ptr, "invert")) deselect_action_keys(&ac, 0, SELECT_INVERT); else @@ -296,7 +296,7 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op) if (RNA_boolean_get(op->ptr, "axis_range")) { /* mode depends on which axis of the range is larger to determine which axis to use * - checking this in region-space is fine, as it's fundamentally still going to be a different rect size - * - the frame-range select option is favoured over the channel one (x over y), as frame-range one is often + * - the frame-range select option is favored over the channel one (x over y), as frame-range one is often * used for tweaking timing when "blocking", while channels is not that useful... */ if ((rect.xmax - rect.xmin) >= (rect.ymax - rect.ymin)) @@ -422,7 +422,7 @@ static void columnselect_action_keys (bAnimContext *ac, short mode) KeyframeEditFunc select_cb, ok_cb; KeyframeEditData ked= {{NULL}}; - /* initialise keyframe editing data */ + /* initialize keyframe editing data */ /* build list of columns */ switch (mode) { diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index 6fabe802ff0..1e21d0e5120 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -63,7 +63,7 @@ static void draw_curve_knot(float x, float y, float xscale, float yscale, float { static GLuint displist=0; - /* initialise round circle shape */ + /* initialize round circle shape */ if (displist == 0) { GLUquadricObj *qobj; diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index 0d046fd985d..c926a4f382c 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -50,21 +50,21 @@ struct FSMenu* fsmenu_get (void); /** Returns the number of entries in the Fileselect Menu */ int fsmenu_get_nentries (struct FSMenu* fsmenu, FSMenuCategory category); - /** Returns the fsmenu entry at @a index (or NULL if a bad index) + /** Returns the fsmenu entry at \a index (or NULL if a bad index) * or a separator. */ char* fsmenu_get_entry (struct FSMenu* fsmenu, FSMenuCategory category, int index); - /** Inserts a new fsmenu entry with the given @a path. + /** Inserts a new fsmenu entry with the given \a path. * Duplicate entries are not added. - * @param sorted Should entry be inserted in sorted order? + * \param sorted Should entry be inserted in sorted order? */ void fsmenu_insert_entry (struct FSMenu* fsmenu, FSMenuCategory category, const char *path, int sorted, short save); /** Return whether the entry was created by the user and can be saved and deleted */ short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int index); - /** Removes the fsmenu entry at the given @a index. */ + /** Removes the fsmenu entry at the given \a index. */ void fsmenu_remove_entry (struct FSMenu* fsmenu, FSMenuCategory category, int index); /** saves the 'bookmarks' to the specified file */ diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index e2ea6849a72..1115d3c4cb4 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -458,7 +458,7 @@ static void graph_panel_driverVar__singleProp(uiLayout *layout, ID *id, DriverVa PointerRNA dtar_ptr; uiLayout *row, *col; - /* initialise RNA pointer to the target */ + /* initialize RNA pointer to the target */ RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr); /* Target ID */ @@ -489,7 +489,7 @@ static void graph_panel_driverVar__rotDiff(uiLayout *layout, ID *id, DriverVar * PointerRNA dtar_ptr, dtar2_ptr; uiLayout *col; - /* initialise RNA pointer to the target */ + /* initialize RNA pointer to the target */ RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr); RNA_pointer_create(id, &RNA_DriverTarget, dtar2, &dtar2_ptr); @@ -525,7 +525,7 @@ static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar * PointerRNA dtar_ptr, dtar2_ptr; uiLayout *col; - /* initialise RNA pointer to the target */ + /* initialize RNA pointer to the target */ RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr); RNA_pointer_create(id, &RNA_DriverTarget, dtar2, &dtar2_ptr); @@ -563,7 +563,7 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar PointerRNA dtar_ptr; uiLayout *col, *sub; - /* initialise RNA pointer to the target */ + /* initialize RNA pointer to the target */ RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr); /* properties */ diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 7bdb37d9651..f1afb3c82db 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -153,7 +153,7 @@ static void draw_fcurve_vertices_keyframes (FCurve *fcu, SpaceIpo *UNUSED(sipo), bglBegin(GL_POINTS); for (i = 0; i < fcu->totvert; i++, bezt++) { - /* as an optimisation step, only draw those in view + /* as an optimization step, only draw those in view * - we apply a correction factor to ensure that points don't pop in/out due to slight twitches of view size */ if IN_RANGE(bezt->vec[1][0], (v2d->cur.xmin - fac), (v2d->cur.xmax + fac)) { @@ -185,7 +185,7 @@ static void draw_fcurve_handle_control (float x, float y, float xscale, float ys { static GLuint displist=0; - /* initialise round circle shape */ + /* initialize round circle shape */ if (displist == 0) { GLUquadricObj *qobj; @@ -428,7 +428,7 @@ static void draw_fcurve_sample_control (float x, float y, float xscale, float ys { static GLuint displist=0; - /* initialise X shape */ + /* initialize X shape */ if (displist == 0) { displist= glGenLists(1); glNewList(displist, GL_COMPILE); @@ -678,7 +678,7 @@ static void draw_fcurve_curve_bezts (bAnimContext *ac, ID *id, FCurve *fcu, View } /* draw curve between first and last keyframe (if there are enough to do so) */ - // TODO: optimise this to not have to calc stuff out of view too? + // TODO: optimize this to not have to calc stuff out of view too? while (b--) { if (prevbezt->ipo==BEZT_IPO_CONST) { /* Constant-Interpolation: draw segment between previous keyframe and next, but holding same value */ @@ -850,7 +850,7 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri /* draw curve: * - curve line may be result of one or more destructive modifiers or just the raw data, * so we need to check which method should be used - * - controls from active modifier take precidence over keyframes + * - controls from active modifier take precedence over keyframes * (XXX! editing tools need to take this into account!) */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index fbcb9546a1b..ffe5147074a 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1582,7 +1582,7 @@ static int graphkeys_euler_filter_exec (bContext *C, wmOperator *op) continue; } - /* optimisation: assume that xyz curves will always be stored consecutively, + /* optimization: assume that xyz curves will always be stored consecutively, * so if the paths or the ID's don't match up, then a curve needs to be added * to a new group */ diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 617dd172c05..2307f1db4f2 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -154,7 +154,7 @@ static int graphkeys_deselectall_exec(bContext *C, wmOperator *op) if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; - /* 'standard' behaviour - check if selected, then apply relevant selection */ + /* 'standard' behavior - check if selected, then apply relevant selection */ if (RNA_boolean_get(op->ptr, "invert")) deselect_graph_keys(&ac, 0, SELECT_INVERT, TRUE); else @@ -325,7 +325,7 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op) if (RNA_boolean_get(op->ptr, "axis_range")) { /* mode depends on which axis of the range is larger to determine which axis to use * - checking this in region-space is fine, as it's fundamentally still going to be a different rect size - * - the frame-range select option is favoured over the channel one (x over y), as frame-range one is often + * - the frame-range select option is favored over the channel one (x over y), as frame-range one is often * used for tweaking timing when "blocking", while channels is not that useful... */ if ((rect.xmax - rect.xmin) >= (rect.ymax - rect.ymin)) @@ -449,7 +449,7 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode) KeyframeEditFunc select_cb, ok_cb; KeyframeEditData ked; - /* initialise keyframe editing data */ + /* initialize keyframe editing data */ memset(&ked, 0, sizeof(KeyframeEditData)); /* build list of columns */ @@ -1180,7 +1180,7 @@ static void mouse_graph_keys (bAnimContext *ac, const int mval[2], short select_ KeyframeEditFunc select_cb; KeyframeEditData ked; - /* initialise keyframe editing data */ + /* initialize keyframe editing data */ memset(&ked, 0, sizeof(KeyframeEditData)); /* set up BezTriple edit callbacks */ @@ -1262,7 +1262,7 @@ static void graphkeys_mselect_column (bAnimContext *ac, const int mval[2], short deselect_graph_keys(ac, 0, SELECT_SUBTRACT, FALSE); } - /* initialise keyframe editing data */ + /* initialize keyframe editing data */ memset(&ked, 0, sizeof(KeyframeEditData)); /* set up BezTriple edit callbacks */ diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index ce7338ced13..7abc0c6ea71 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -276,7 +276,7 @@ int ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit) return 0; if(obedit && obedit->type == OB_MESH) { - struct BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh; + struct BMEditMesh *em = BMEdit_FromObject(obedit); int ret; ret = EDBM_texFaceCheck(em); @@ -294,7 +294,7 @@ int ED_space_image_show_uvshadow(SpaceImage *sima, Object *obedit) if(ED_space_image_show_paint(sima)) if(obedit && obedit->type == OB_MESH) { - struct BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh; + struct BMEditMesh *em = BMEdit_FromObject(obedit); int ret; ret = EDBM_texFaceCheck(em); diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 54e8b1b490d..e4febdef73b 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -362,7 +362,7 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm } if (rti->widthfac == 0.0f) { - /* initialise colors based on report type */ + /* initialize colors based on report type */ if(report->type & RPT_ERROR_ALL) { rti->col[0] = 1.0; rti->col[1] = 0.2; diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index cf003d8c1eb..120783db340 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -140,7 +140,7 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats) static void stats_object_edit(Object *obedit, SceneStats *stats) { if(obedit->type==OB_MESH) { - BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); stats->totvert = em->bm->totvert; stats->totvertsel = em->bm->totvertsel; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index d7a1053f3c1..0253f04a05d 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -172,7 +172,7 @@ static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float co color[2]= 0.86f; } else { - /* normal, unselected strip - use (hardly noticable) blue tinge */ + /* normal, unselected strip - use (hardly noticeable) blue tinge */ // FIXME: hardcoded temp-hack colors color[0]= 0.11f; color[1]= 0.15f; @@ -190,7 +190,7 @@ static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float co color[2]= 0.59f; } else { - /* normal, unselected strip - use (hardly noticable) dark purple tinge */ + /* normal, unselected strip - use (hardly noticeable) dark purple tinge */ // FIXME: hardcoded temp-hack colors color[0]= 0.20f; color[1]= 0.15f; @@ -207,7 +207,7 @@ static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float co color[2]= 0.48f; } else { - /* normal, unselected strip - use (hardly noticable) teal tinge */ + /* normal, unselected strip - use (hardly noticeable) teal tinge */ // FIXME: hardcoded temp-hack colors color[0]= 0.17f; color[1]= 0.24f; @@ -813,7 +813,7 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie /* only on top two corners, to show that this channel sits on top of the preceding ones */ uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT); - /* draw slightly shifted up vertically to look like it has more separtion from other channels, + /* draw slightly shifted up vertically to look like it has more separation from other channels, * but we then need to slightly shorten it so that it doesn't look like it overlaps */ uiDrawBox(GL_POLYGON, x+offset, yminc+NLACHANNEL_SKIP, (float)v2d->cur.xmax, ymaxc+NLACHANNEL_SKIP-1, 8); diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index d7dfea0b7e7..a142119d685 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1619,7 +1619,7 @@ void NLA_OT_action_sync_length (wmOperatorType *ot) /* identifiers */ ot->name= "Sync Action Length"; ot->idname= "NLA_OT_action_sync_length"; - ot->description= "Synchronise the length of the referenced Action with the length used in the strip"; + ot->description= "Synchronize the length of the referenced Action with the length used in the strip"; /* api callbacks */ ot->exec= nlaedit_sync_actlen_exec; diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 0cb48582bc9..6ad83f6591a 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -171,7 +171,7 @@ static int nlaedit_deselectall_exec(bContext *C, wmOperator *op) if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; - /* 'standard' behaviour - check if selected, then apply relevant selection */ + /* 'standard' behavior - check if selected, then apply relevant selection */ if (RNA_boolean_get(op->ptr, "invert")) deselect_nla_strips(&ac, DESELECT_STRIPS_NOTEST, SELECT_INVERT); else @@ -308,7 +308,7 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op) if (RNA_boolean_get(op->ptr, "axis_range")) { /* mode depends on which axis of the range is larger to determine which axis to use * - checking this in region-space is fine, as it's fundamentally still going to be a different rect size - * - the frame-range select option is favoured over the channel one (x over y), as frame-range one is often + * - the frame-range select option is favored over the channel one (x over y), as frame-range one is often * used for tweaking timing when "blocking", while channels is not that useful... */ if ((rect.xmax - rect.xmin) >= (rect.ymax - rect.ymin)) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index a58e03be237..bc22e668b5a 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -102,24 +102,71 @@ static void node_socket_button_label(const bContext *UNUSED(C), uiBlock *block, uiDefBut(block, LABEL, 0, sock->name, x, y, width, NODE_DY, NULL, 0, 0, 0, 0, ""); } +/* draw function for file output node sockets. + * XXX a bit ugly use atm, called from datatype button functions, + * since all node types and callbacks only use data type without struct_type. + */ +static void node_socket_button_output_file(const bContext *C, uiBlock *block, + bNodeTree *ntree, bNode *node, bNodeSocket *sock, + const char *UNUSED(name), int x, int y, int width) +{ + uiLayout *layout, *row; + PointerRNA nodeptr, sockptr, imfptr; + int imtype; + int rx, ry; + RNA_pointer_create(&ntree->id, &RNA_Node, node, &nodeptr); + RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &sockptr); + + layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, x, y+NODE_DY, width, 20, UI_GetStyle()); + row = uiLayoutRow(layout, 0); + + uiItemL(row, sock->name, 0); + + imfptr = RNA_pointer_get(&nodeptr, "format"); + imtype = RNA_enum_get(&imfptr, "file_format"); + /* in multilayer format all socket format details are ignored */ + if (imtype != R_IMF_IMTYPE_MULTILAYER) { + PropertyRNA *imtype_prop; + const char *imtype_name; + + if (!RNA_boolean_get(&sockptr, "use_node_format")) + imfptr = RNA_pointer_get(&sockptr, "format"); + + imtype_prop = RNA_struct_find_property(&imfptr, "file_format"); + RNA_property_enum_name((bContext*)C, &imfptr, imtype_prop, RNA_property_enum_get(&imfptr, imtype_prop), &imtype_name); + uiBlockSetEmboss(block, UI_EMBOSSP); + uiItemL(row, imtype_name, 0); + uiBlockSetEmboss(block, UI_EMBOSSN); + } + + uiBlockLayoutResolve(block, &rx, &ry); +} static void node_socket_button_default(const bContext *C, uiBlock *block, bNodeTree *ntree, bNode *node, bNodeSocket *sock, const char *name, int x, int y, int width) { - if (sock->link || (sock->flag & SOCK_HIDE_VALUE)) - node_socket_button_label(C, block, ntree, node, sock, name, x, y, width); - else { - PointerRNA ptr; - uiBut *bt; - - RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr); - - bt = uiDefButR(block, NUM, B_NODE_EXEC, name, - x, y+1, width, NODE_DY-2, - &ptr, "default_value", 0, 0, 0, -1, -1, NULL); - if (node) - uiButSetFunc(bt, node_sync_cb, CTX_wm_space_node(C), node); + switch (sock->struct_type) { + case SOCK_STRUCT_NONE: { + if (sock->link || (sock->flag & SOCK_HIDE_VALUE)) + node_socket_button_label(C, block, ntree, node, sock, name, x, y, width); + else { + PointerRNA ptr; + uiBut *bt; + + RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr); + + bt = uiDefButR(block, NUM, B_NODE_EXEC, name, + x, y+1, width, NODE_DY-2, + &ptr, "default_value", 0, 0, 0, -1, -1, NULL); + if (node) + uiButSetFunc(bt, node_sync_cb, CTX_wm_space_node(C), node); + } + break; + } + case SOCK_STRUCT_OUTPUT_FILE: + node_socket_button_output_file(C, block, ntree, node, sock, name, x, y, width); + break; } } @@ -149,25 +196,33 @@ static void node_socket_button_components(const bContext *C, uiBlock *block, bNodeTree *ntree, bNode *node, bNodeSocket *sock, const char *name, int x, int y, int width) { - if (sock->link || (sock->flag & SOCK_HIDE_VALUE)) - node_socket_button_label(C, block, ntree, node, sock, name, x, y, width); - else { - PointerRNA ptr; - SocketComponentMenuArgs *args; - - RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr); - - args= MEM_callocN(sizeof(SocketComponentMenuArgs), "SocketComponentMenuArgs"); - - args->ptr = ptr; - args->x = x; - args->y = y; - args->width = width; - args->cb = node_sync_cb; - args->arg1 = CTX_wm_space_node(C); - args->arg2 = node; - - uiDefBlockButN(block, socket_component_menu, args, name, x, y+1, width, NODE_DY-2, ""); + switch (sock->struct_type) { + case SOCK_STRUCT_NONE: { + if (sock->link || (sock->flag & SOCK_HIDE_VALUE)) + node_socket_button_label(C, block, ntree, node, sock, name, x, y, width); + else { + PointerRNA ptr; + SocketComponentMenuArgs *args; + + RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr); + + args= MEM_callocN(sizeof(SocketComponentMenuArgs), "SocketComponentMenuArgs"); + + args->ptr = ptr; + args->x = x; + args->y = y; + args->width = width; + args->cb = node_sync_cb; + args->arg1 = CTX_wm_space_node(C); + args->arg2 = node; + + uiDefBlockButN(block, socket_component_menu, args, name, x, y+1, width, NODE_DY-2, ""); + } + break; + } + case SOCK_STRUCT_OUTPUT_FILE: + node_socket_button_output_file(C, block, ntree, node, sock, name, x, y, width); + break; } } @@ -200,29 +255,10 @@ static void node_socket_button_color(const bContext *C, uiBlock *block, } break; } - case SOCK_STRUCT_OUTPUT_MULTI_FILE: { - uiLayout *layout, *row; - PointerRNA ptr, imfptr; - PropertyRNA *imtype_prop; - const char *imtype_name; - int rx, ry; - RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr); - imfptr = RNA_pointer_get(&ptr, "format"); - - layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, x, y+NODE_DY, width, 20, UI_GetStyle()); - row = uiLayoutRow(layout, 0); - - uiItemL(row, sock->name, 0); - imtype_prop = RNA_struct_find_property(&imfptr, "file_format"); - RNA_property_enum_name((bContext*)C, &imfptr, imtype_prop, RNA_property_enum_get(&imfptr, imtype_prop), &imtype_name); - uiBlockSetEmboss(block, UI_EMBOSSP); - uiItemL(row, imtype_name, 0); - uiBlockSetEmboss(block, UI_EMBOSSN); - - uiBlockLayoutResolve(block, &rx, &ry); + case SOCK_STRUCT_OUTPUT_FILE: + node_socket_button_output_file(C, block, ntree, node, sock, name, x, y, width); break; } - } } /* ****************** BASE DRAW FUNCTIONS FOR NEW OPERATOR NODES ***************** */ @@ -1699,56 +1735,54 @@ static void node_composit_buts_id_mask(uiLayout *layout, bContext *UNUSED(C), Po static void node_composit_buts_file_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { - bNode *node= ptr->data; - NodeImageFile *nif= node->storage; - PointerRNA imfptr; - - uiLayout *row; - - uiItemR(layout, ptr, "filepath", 0, "", ICON_NONE); - - RNA_pointer_create(NULL, &RNA_ImageFormatSettings, &nif->im_format, &imfptr); - uiTemplateImageSettings(layout, &imfptr); - - row= uiLayoutRow(layout, 1); - uiItemR(row, ptr, "frame_start", 0, "Start", ICON_NONE); - uiItemR(row, ptr, "frame_end", 0, "End", ICON_NONE); -} - -static void node_composit_buts_multi_file_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) -{ - uiItemL(layout, "Base Path:", 0); + PointerRNA imfptr = RNA_pointer_get(ptr, "format"); + int multilayer = (RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_MULTILAYER); + + if (multilayer) + uiItemL(layout, "Path:", 0); + else + uiItemL(layout, "Base Path:", 0); uiItemR(layout, ptr, "base_path", 0, "", ICON_NONE); } -static void node_composit_buts_multi_file_output_details(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_file_output_details(uiLayout *layout, bContext *C, PointerRNA *ptr) { + PointerRNA imfptr = RNA_pointer_get(ptr, "format"); PointerRNA active_input_ptr = RNA_pointer_get(ptr, "active_input"); + int multilayer = (RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_MULTILAYER); - node_composit_buts_multi_file_output(layout, C, ptr); + node_composit_buts_file_output(layout, C, ptr); + uiTemplateImageSettings(layout, &imfptr); + + uiItemS(layout); - uiItemO(layout, "Add Input", ICON_ZOOMIN, "NODE_OT_output_multi_file_add_socket"); + uiItemO(layout, "Add Input", ICON_ZOOMIN, "NODE_OT_output_file_add_socket"); uiTemplateList(layout, C, ptr, "inputs", ptr, "active_input_index", NULL, 0, 0, 0); if (active_input_ptr.data) { - PointerRNA imfptr = RNA_pointer_get(&active_input_ptr, "format"); uiLayout *row, *col; col = uiLayoutColumn(layout, 1); - uiItemL(col, "File Path:", 0); + if (multilayer) + uiItemL(col, "Layer Name:", 0); + else + uiItemL(col, "File Path:", 0); row = uiLayoutRow(col, 0); uiItemR(row, &active_input_ptr, "name", 0, "", 0); - uiItemFullO(row, "NODE_OT_output_multi_file_remove_active_socket", "", ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY); - - uiItemS(layout); + uiItemFullO(row, "NODE_OT_output_file_remove_active_socket", "", ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY); - col = uiLayoutColumn(layout, 1); - uiItemL(col, "Format:", 0); - uiItemR(col, &active_input_ptr, "use_render_format", 0, NULL, 0); - - col= uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(&active_input_ptr, "use_render_format")==0); - uiTemplateImageSettings(col, &imfptr); + /* in multilayer format all socket format details are ignored */ + if (!multilayer) { + imfptr = RNA_pointer_get(&active_input_ptr, "format"); + + col = uiLayoutColumn(layout, 1); + uiItemL(col, "Format:", 0); + uiItemR(col, &active_input_ptr, "use_node_format", 0, NULL, 0); + + col= uiLayoutColumn(layout, 0); + uiLayoutSetActive(col, RNA_boolean_get(&active_input_ptr, "use_node_format")==0); + uiTemplateImageSettings(col, &imfptr); + } } } @@ -1986,10 +2020,7 @@ static void node_composit_set_butfunc(bNodeType *ntype) break; case CMP_NODE_OUTPUT_FILE: ntype->uifunc= node_composit_buts_file_output; - break; - case CMP_NODE_OUTPUT_MULTI_FILE: - ntype->uifunc= node_composit_buts_multi_file_output; - ntype->uifuncbut= node_composit_buts_multi_file_output_details; + ntype->uifuncbut= node_composit_buts_file_output_details; break; case CMP_NODE_DIFF_MATTE: ntype->uifunc=node_composit_buts_diff_matte; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index c89e91724fb..a6d18b58cca 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -2254,6 +2254,8 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeSocket *tsock, bNodeL } else nodeRemLink(snode->edittree, tlink); + + snode->edittree->update |= NTREE_UPDATE_LINKS; } } } @@ -3515,49 +3517,47 @@ void NODE_OT_new_node_tree(wmOperatorType *ot) RNA_def_string(ot->srna, "name", "NodeTree", MAX_ID_NAME-2, "Name", ""); } -/* ****************** Multi File Output Add Socket ******************* */ +/* ****************** File Output Add Socket ******************* */ -static int node_output_multi_file_add_socket_exec(bContext *C, wmOperator *UNUSED(op)) +static int node_output_file_add_socket_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); SpaceNode *snode= CTX_wm_space_node(C); bNodeTree *ntree = snode->edittree; bNode *node = nodeGetActive(ntree); + char file_path[MAX_NAME]; if (!node) return OPERATOR_CANCELLED; - ntreeCompositOutputMultiFileAddSocket(ntree, node, &scene->r.im_format); + RNA_string_get(op->ptr, "file_path", file_path); + ntreeCompositOutputFileAddSocket(ntree, node, file_path, &scene->r.im_format); snode_notify(C, snode); return OPERATOR_FINISHED; } -static int node_output_multi_file_add_socket_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) -{ - return node_output_multi_file_add_socket_exec(C, op); -} - -void NODE_OT_output_multi_file_add_socket(wmOperatorType *ot) +void NODE_OT_output_file_add_socket(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Multi File Node Socket"; - ot->description= "Add a new input to a multi file output node"; - ot->idname= "NODE_OT_output_multi_file_add_socket"; + ot->name= "Add File Node Socket"; + ot->description= "Add a new input to a file output node"; + ot->idname= "NODE_OT_output_file_add_socket"; /* callbacks */ - ot->exec= node_output_multi_file_add_socket_exec; - ot->invoke= node_output_multi_file_add_socket_invoke; + ot->exec= node_output_file_add_socket_exec; ot->poll= composite_node_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_string(ot->srna, "file_path", "Image", MAX_NAME, "File Path", "Sub-path of the output file"); } /* ****************** Multi File Output Remove Socket ******************* */ -static int node_output_multi_file_remove_active_socket_exec(bContext *C, wmOperator *UNUSED(op)) +static int node_output_file_remove_active_socket_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); bNodeTree *ntree = snode->edittree; @@ -3566,7 +3566,7 @@ static int node_output_multi_file_remove_active_socket_exec(bContext *C, wmOpera if (!node) return OPERATOR_CANCELLED; - if (!ntreeCompositOutputMultiFileRemoveActiveSocket(ntree, node)) + if (!ntreeCompositOutputFileRemoveActiveSocket(ntree, node)) return OPERATOR_CANCELLED; snode_notify(C, snode); @@ -3574,15 +3574,15 @@ static int node_output_multi_file_remove_active_socket_exec(bContext *C, wmOpera return OPERATOR_FINISHED; } -void NODE_OT_output_multi_file_remove_active_socket(wmOperatorType *ot) +void NODE_OT_output_file_remove_active_socket(wmOperatorType *ot) { /* identifiers */ - ot->name= "Remove Multi File Node Socket"; - ot->description= "Remove active input from a multi file output node"; - ot->idname= "NODE_OT_output_multi_file_remove_active_socket"; + ot->name= "Remove File Node Socket"; + ot->description= "Remove active input from a file output node"; + ot->idname= "NODE_OT_output_file_remove_active_socket"; /* callbacks */ - ot->exec= node_output_multi_file_remove_active_socket_exec; + ot->exec= node_output_file_remove_active_socket_exec; ot->poll= composite_node_active; /* flags */ diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index f6d52aa9474..2524454d9c0 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -157,8 +157,8 @@ void NODE_OT_add_file(struct wmOperatorType *ot); void NODE_OT_new_node_tree(struct wmOperatorType *ot); -void NODE_OT_output_multi_file_add_socket(struct wmOperatorType *ot); -void NODE_OT_output_multi_file_remove_active_socket(struct wmOperatorType *ot); +void NODE_OT_output_file_add_socket(struct wmOperatorType *ot); +void NODE_OT_output_file_remove_active_socket(struct wmOperatorType *ot); extern const char *node_context_dir[]; diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 608c6b51f70..d358556d36a 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -101,8 +101,8 @@ void node_operatortypes(void) WM_operatortype_append(NODE_OT_new_node_tree); - WM_operatortype_append(NODE_OT_output_multi_file_add_socket); - WM_operatortype_append(NODE_OT_output_multi_file_remove_active_socket); + WM_operatortype_append(NODE_OT_output_file_add_socket); + WM_operatortype_append(NODE_OT_output_file_remove_active_socket); } void ED_operatormacros_node(void) diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 493fb854585..93d3b22e092 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -339,7 +339,7 @@ static void node_buttons_area_draw(const bContext *C, ARegion *ar) ED_region_panels(C, ar, 1, NULL, -1); } -/* Initialise main area, setting handlers. */ +/* Initialize main area, setting handlers. */ static void node_main_area_init(wmWindowManager *wm, ARegion *ar) { wmKeyMap *keymap; diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index de798e5c23b..ca0a9c15c8c 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -978,7 +978,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle PropertyRNA *prop; char *newpath=NULL; - /* optimise tricks: + /* optimize tricks: * - Don't do anything if the selected item is a 'struct', but arrays are allowed */ if (tselem->type == TSE_RNA_STRUCT) diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 438016a38fa..df38f87b798 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -92,7 +92,7 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag) RNA_def_int(ot->srna, "frame_start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame of the sequence strip", INT_MIN, INT_MAX); if(flag & SEQPROP_ENDFRAME) - RNA_def_int(ot->srna, "frame_end", 0, INT_MIN, INT_MAX, "End Frame", "End frame for the color strip", INT_MIN, INT_MAX); /* not useual since most strips have a fixed length */ + RNA_def_int(ot->srna, "frame_end", 0, INT_MIN, INT_MAX, "End Frame", "End frame for the color strip", INT_MIN, INT_MAX); /* not usual since most strips have a fixed length */ RNA_def_int(ot->srna, "channel", 1, 1, MAXSEQ, "Channel", "Channel to place this strip into", 1, MAXSEQ); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 55fc84b6707..32c7be99e94 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -1094,7 +1094,7 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq) seq->flag |= SELECT; changed = TRUE; - /* Unfortunately, we must restart checks from the begining. */ + /* Unfortunately, we must restart checks from the beginning. */ seq_end(&iter); seq_begin(ed, &iter, 1); } diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index db8c1b230ba..a44d5909a4f 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1133,7 +1133,7 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op) } if(type == TO_TABS) // Converting to tabs - { //start over from the begining + { //start over from the beginning tmp = text->lines.first; while(tmp) { diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index 553a04206f7..922102e3921 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -179,7 +179,7 @@ void draw_motion_path_instance(Scene *scene, glPointSize(1.0); /* draw little black point at each frame - * NOTE: this is not really visible/noticable + * NOTE: this is not really visible/noticeable */ glBegin(GL_POINTS); for (i=0, mpv=mpv_start; i < len; i++, mpv++) diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 705b3c52d4b..e611ae1b64c 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -662,7 +662,7 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel dirvec[2]= 0.0f; if (head != tail) { - /* correcyion when viewing along the bones axis + /* correction when viewing along the bones axis * it pops in and out but better then artifacts, [#23841] */ float view_dist= len_v2(dirvec); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 083b6ad06db..fd978cf8fef 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1482,7 +1482,7 @@ static void draw_limit_line(float sta, float end, unsigned int col) /* yafray: draw camera focus point (cross, similar to aqsis code in tuhopuu) */ -/* qdn: now also enabled for Blender to set focus point for defocus composit node */ +/* qdn: now also enabled for Blender to set focus point for defocus composite node */ static void draw_focus_cross(float dist, float size) { glBegin(GL_LINES); @@ -1822,7 +1822,7 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base if (cam->flag & CAM_SHOWLIMITS) { draw_limit_line(cam->clipsta, cam->clipend, 0x77FFFF); - /* qdn: was yafray only, now also enabled for Blender to be used with defocus composit node */ + /* qdn: was yafray only, now also enabled for Blender to be used with defocus composite node */ draw_focus_cross(object_camera_dof_distance(ob), cam->drawsize); } @@ -2018,7 +2018,7 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob) /* Note! - foreach funcs should be called while drawing or directly after * if not, ED_view3d_init_mats_rv3d() can be used for selection tools * but would not give correct results with dupli's for eg. which dont - * use the object matrix in the useual way */ + * use the object matrix in the usual way */ static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) { foreachScreenVert_userData *data = userData; @@ -4159,7 +4159,7 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix /* mostly tries to use vertex arrays for speed */ /* 1. check that everything is ok & updated */ -/* 2. start initialising things */ +/* 2. start initializing things */ /* 3. initialize according to draw type */ /* 4. allocate drawing data arrays */ /* 5. start filling the arrays */ diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 3c4e3b6009c..3e2979a7e88 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -131,6 +131,36 @@ typedef struct { float *defweightp; } TransformProperties; +/* Helper function to compute a median changed value, + * when the value should be clamped in [0.0, 1.0]. + * Returns either 0.0, 1.0 (both can be applied directly), a positive scale factor + * for scale down, or a negative one for scale up. + */ +static float compute_scale_factor(const float ve_median, const float median) +{ + if (ve_median <= 0.0f) + return 0.0f; + else if (ve_median >= 1.0f) + return 1.0f; + else { + /* Scale value to target median. */ + float median_new = ve_median; + float median_orig = ve_median - median; /* Previous median value. */ + + /* In case of floating point error. */ + CLAMP(median_orig, 0.0f, 1.0f); + CLAMP(median_new, 0.0f, 1.0f); + + if (median_new <= median_orig) { + /* Scale down. */ + return median_new / median_orig; + } + else { + /* Scale up, negative to indicate it... */ + return -(1.0f - median_new) / (1.0f - median_orig); + } + } +} /* is used for both read and write... */ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim) @@ -312,78 +342,45 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float uiBut *but; memcpy(tfp->ve_median, median, sizeof(tfp->ve_median)); - + uiBlockBeginAlign(block); if (tot==1) { uiDefBut(block, LABEL, 0, "Vertex:", 0, 150, 200, 20, NULL, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 130, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, ""); - uiButSetUnitType(but, PROP_UNIT_LENGTH); - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 110, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, ""); - uiButSetUnitType(but, PROP_UNIT_LENGTH); - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, ""); - uiButSetUnitType(but, PROP_UNIT_LENGTH); - - if (totw==1) { - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, ""); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); - uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); - uiBlockEndAlign(block); - if (totweight) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, ""); - if (totradius) { - if (totradius==1) uiDefButR(block, NUM, 0, "Radius", 0, 20, 200, 20, &radius_ptr, "radius", 0, 0.0, 100.0, 10, 3, NULL); - else uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs"); - } - } - else { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); - uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); - uiBlockEndAlign(block); - if (totweight) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, ""); - if (totradius) { - if (totradius==1) uiDefButR(block, NUM, 0, "Radius", 0, 40, 200, 20, &radius_ptr, "radius", 0, 0.0, 100.0, 10, 3, NULL); - else uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 40, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); - } - } } else { uiDefBut(block, LABEL, 0, "Median:", 0, 150, 200, 20, NULL, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 130, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, ""); - uiButSetUnitType(but, PROP_UNIT_LENGTH); - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 110, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, ""); - uiButSetUnitType(but, PROP_UNIT_LENGTH); - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, ""); - uiButSetUnitType(but, PROP_UNIT_LENGTH); - if (totw==tot) { - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, ""); - uiBlockEndAlign(block); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); - uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); - uiBlockEndAlign(block); - if (totweight) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "Weight is used for SoftBody Goal"); - if (totradius) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); - uiBlockEndAlign(block); - } - else { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); - uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); - uiBlockEndAlign(block); - if (totweight) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "Weight is used for SoftBody Goal"); - if (totradius) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs"); - uiBlockEndAlign(block); - } + } + + uiBlockBeginAlign(block); + + but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 130, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, ""); + uiButSetUnitType(but, PROP_UNIT_LENGTH); + but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 110, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, ""); + uiButSetUnitType(but, PROP_UNIT_LENGTH); + but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, ""); + uiButSetUnitType(but, PROP_UNIT_LENGTH); + + if (totw==tot) { + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, ""); + } + + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); + uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); + uiBlockEndAlign(block); + + if (totweight == 1) { + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "Weight is used for SoftBody Goal"); + } + else if (totweight > 1) { + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "Weight is used for SoftBody Goal"); + } + + if (totradius == 1) { + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs"); + } + else if (totradius > 1) { + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs"); } if (totedge==1) { @@ -395,6 +392,9 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Bevel Weight:", 0, 20, 200, 20, &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, ""); } + uiBlockEndAlign(block); + uiBlockEndAlign(block); + } else { // apply memcpy(ve_median, tfp->ve_median, sizeof(tfp->ve_median)); @@ -430,54 +430,35 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float if (median[3] != 0.0f) { BMEdge *eed; - const float fixed_crease= (ve_median[3] <= 0.0f ? 0.0f : (ve_median[3] >= 1.0f ? 1.0f : FLT_MAX)); - - if (fixed_crease != FLT_MAX) { - /* simple case */ + const float sca = compute_scale_factor(ve_median[3], median[3]); + if (ELEM(sca, 0.0f, 1.0f)) { BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) { float *crease = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE); - if (!crease) break; - - *crease= fixed_crease; + if (crease) { + *crease = sca; + } } } } - else { - /* scale crease to target median */ - float median_new= ve_median[3]; - float median_orig= ve_median[3] - median[3]; /* previous median value */ - - /* incase of floating point error */ - CLAMP(median_orig, 0.0f, 1.0f); - CLAMP(median_new, 0.0f, 1.0f); - - if (median_new < median_orig) { - /* scale down */ - const float sca= median_new / median_orig; - - BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { - if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) { - float *crease = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE); - - if (!crease) break; - + else if (sca > 0.0f) { + BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { + if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) { + float *crease = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE); + if (crease) { *crease *= sca; CLAMP(*crease, 0.0f, 1.0f); } } } - else { - /* scale up */ - const float sca= (1.0f - median_new) / (1.0f - median_orig); - - BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { - if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) { - float *crease = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE); - if (!crease) break; - - *crease = 1.0f - ((1.0f - *crease) * sca); + } + else { + BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { + if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) { + float *crease = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE); + if (crease) { + *crease = 1.0f + ((1.0f - *crease) * sca); CLAMP(*crease, 0.0f, 1.0f); } } @@ -487,53 +468,35 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float if (median[6] != 0.0f) { BMEdge *eed; - const float fixed_bweight = (ve_median[6] <= 0.0f ? 0.0f : (ve_median[6] >= 1.0f ? 1.0f : FLT_MAX)); - - if (fixed_bweight != FLT_MAX) { - /* simple case */ + const float sca = compute_scale_factor(ve_median[6], median[6]); + if (ELEM(sca, 0.0f, 1.0f)) { BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) { float *bweight = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT); - if (!bweight) break; - - *bweight = fixed_bweight; + if (bweight) { + *bweight = sca; + } } } } - else { - /* scale crease to target median */ - float median_new = ve_median[6]; - float median_orig = ve_median[6] - median[6]; /* previous median value */ - - /* incase of floating point error */ - CLAMP(median_orig, 0.0f, 1.0f); - CLAMP(median_new, 0.0f, 1.0f); - - if (median_new < median_orig) { - /* scale down */ - const float sca = median_new / median_orig; - - BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { - if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) { - float *bweight = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT); - if (!bweight) break; - + else if (sca > 0.0f) { + BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { + if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) { + float *bweight = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT); + if (bweight) { *bweight *= sca; CLAMP(*bweight, 0.0f, 1.0f); } } } - else { - /* scale up */ - const float sca = (1.0f - median_new) / (1.0f - median_orig); - - BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { - if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) { - float *bweight = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT); - if (!bweight) break; - - *bweight = 1.0f - ((1.0f - *bweight) * sca); + } + else { + BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { + if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) { + float *bweight = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT); + if (bweight) { + *bweight = 1.0f + ((1.0f - *bweight) * sca); CLAMP(*bweight, 0.0f, 1.0f); } } @@ -549,6 +512,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float BezTriple *bezt; int a; ListBase *nurbs= curve_editnurbs(cu); + const float scale_w = compute_scale_factor(ve_median[4], median[4]); nu= nurbs->first; while (nu) { @@ -560,7 +524,18 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float add_v3_v3(bezt->vec[0], median); add_v3_v3(bezt->vec[1], median); add_v3_v3(bezt->vec[2], median); - bezt->weight+= median[4]; + + if (median[4] != 0.0f) { + if (ELEM(scale_w, 0.0f, 1.0f)) { + bezt->weight = scale_w; + } + else { + bezt->weight = scale_w > 0.0f ? bezt->weight * scale_w : + 1.0f + ((1.0f - bezt->weight) * scale_w); + CLAMP(bezt->weight, 0.0f, 1.0f); + } + } + bezt->radius+= median[5]; } else { @@ -581,7 +556,18 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float if (bp->f1 & SELECT) { add_v3_v3(bp->vec, median); bp->vec[3]+= median[3]; - bp->weight+= median[4]; + + if (median[4] != 0.0f) { + if (ELEM(scale_w, 0.0f, 1.0f)) { + bp->weight = scale_w; + } + else { + bp->weight = scale_w > 0.0f ? bp->weight * scale_w : + 1.0f + ((1.0f - bp->weight) * scale_w); + CLAMP(bp->weight, 0.0f, 1.0f); + } + } + bp->radius+= median[5]; } bp++; @@ -597,13 +583,24 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float Lattice *lt= ob->data; BPoint *bp; int a; - + const float scale_w = compute_scale_factor(ve_median[4], median[4]); + a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw; bp= lt->editlatt->latt->def; while (a--) { if (bp->f1 & SELECT) { add_v3_v3(bp->vec, median); - bp->weight+= median[4]; + + if (median[4] != 0.0f) { + if (ELEM(scale_w, 0.0f, 1.0f)) { + bp->weight = scale_w; + } + else { + bp->weight = scale_w > 0.0f ? bp->weight * scale_w : + 1.0f + ((1.0f - bp->weight) * scale_w); + CLAMP(bp->weight, 0.0f, 1.0f); + } + } } bp++; } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 1fdffbed42c..dd121265522 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1078,7 +1078,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) /* note: quite un-scientific but without this bit extra * 0.0001 on the lower left the 2D border sometimes * obscures the 3D camera border */ - /* note: with VIEW3D_CAMERA_BORDER_HACK defined this error isn't noticable + /* note: with VIEW3D_CAMERA_BORDER_HACK defined this error isn't noticeable * but keep it here incase we need to remove the workaround */ x1i= (int)(x1 - 1.0001f); y1i= (int)(y1 - 1.0001f); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 8d91962594f..c78d63c174b 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -3108,7 +3108,7 @@ void VIEW3D_OT_background_image_remove(wmOperatorType *ot) /* flags */ ot->flag = 0; - RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Background image index to remove ", 0, INT_MAX); + RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Background image index to remove", 0, INT_MAX); } /* ********************* set clipping operator ****************** */ diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 29ef1f1b617..f80bd6c3807 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -333,17 +333,17 @@ static char *view3d_modeselect_pup(Scene *scene) static void do_view3d_header_buttons(bContext *C, void *UNUSED(arg), int event) { - wmWindow *win= CTX_wm_window(C); - ToolSettings *ts= CTX_data_tool_settings(C); - ScrArea *sa= CTX_wm_area(C); - View3D *v3d= sa->spacedata.first; + wmWindow *win = CTX_wm_window(C); + ToolSettings *ts = CTX_data_tool_settings(C); + ScrArea *sa = CTX_wm_area(C); + View3D *v3d = sa->spacedata.first; Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em= NULL; - int ctrl= win->eventstate->ctrl, shift= win->eventstate->shift; + BMEditMesh *em = NULL; + int ctrl = win->eventstate->ctrl, shift= win->eventstate->shift; PointerRNA props_ptr; - if (obedit && obedit->type==OB_MESH) { - em= ((Mesh *)obedit->data)->edit_btmesh; + if (obedit && obedit->type == OB_MESH) { + em = BMEdit_FromObject(obedit); } /* watch it: if sa->win does not exist, check that when calling direct drawing routines */ @@ -449,7 +449,7 @@ void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C) uiBlockSetHandleFunc(block, do_view3d_header_buttons, NULL); if (obedit && (obedit->type == OB_MESH)) { - BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); uiLayout *row; row= uiLayoutRow(layout, 1); diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 4cf0c9d0c9b..168775deae2 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -199,7 +199,7 @@ extern const char *view3d_context_dir[]; /* doc access */ /* draw_volume.c */ void draw_volume(struct ARegion *ar, struct GPUTexture *tex, float *min, float *max, int res[3], float dx, struct GPUTexture *tex_shadow); -/* workaround for trivial but noticable camera bug caused by imprecision +/* workaround for trivial but noticeable camera bug caused by imprecision * between view border calculation in 2D/3D space, workaround for bug [#28037]. * without this deifne we get the old behavior which is to try and align them * both which _mostly_ works fine, but when the camera moves beyond ~1000 in diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index dfd8b4a3568..a5c7e21e3b4 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -516,7 +516,7 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves, lasso_select_boundbox(&rect, mcords, moves); /* set editmesh */ - vc->em= ((Mesh *)vc->obedit->data)->edit_btmesh; + vc->em = BMEdit_FromObject(vc->obedit); data.vc= vc; data.rect = ▭ @@ -2073,7 +2073,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) if (vc.obedit) { switch(vc.obedit->type) { case OB_MESH: - vc.em= ((Mesh *)vc.obedit->data)->edit_btmesh; + vc.em = BMEdit_FromObject(vc.obedit); ret= do_mesh_box_select(&vc, &rect, select, extend); // if (EM_texFaceCheck()) if (ret & OPERATOR_FINISHED) { @@ -2336,7 +2336,7 @@ static void mesh_circle_select(ViewContext *vc, int select, const int mval[2], f bbsel= EDBM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0)); ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */ - vc->em= ((Mesh *)vc->obedit->data)->edit_btmesh; + vc->em = BMEdit_FromObject(vc->obedit); data.vc = vc; data.select = select; diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 3f49df88ff8..5d2f0c432fb 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -285,7 +285,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode) BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) if (BM_elem_index_get(eve)) tottrans++; } - /* for any of the 3 loops above which all dirty the indicies */ + /* for any of the 3 loops above which all dirty the indices */ bm->elem_index_dirty |= BM_VERT; /* and now make transverts */ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 98046ecb991..61fcf0d6def 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4783,16 +4783,6 @@ void freeSlideVerts(TransInfo *t) if (!sld) return; - /*handle multires reprojection, done - on transform completion since it's - really slow -joeedh*/ - if (t->state != TRANS_CANCEL) { - projectSVData(t, 1); - } else { - sld->perc = 0.0; - projectSVData(t, 0); - } - freeSlideTempFaces(sld); sld->em->bm->ob = t->obedit; @@ -5365,7 +5355,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d, #if 0 /* 'doTime' disabled for now */ const Scene *scene= t->scene; - const short doTime= 0; //getAnimEdit_DrawTime(t); // NOTE: this works, but may be confusing behaviour given the option's label, hence disabled + const short doTime= 0; //getAnimEdit_DrawTime(t); // NOTE: this works, but may be confusing behavior given the option's label, hence disabled const double secf= FPS; #endif double val; @@ -5446,7 +5436,7 @@ void initTimeTranslate(TransInfo *t) t->num.flag = 0; t->num.idx_max = t->idx_max; - /* initialise snap like for everything else */ + /* initialize snap like for everything else */ t->snap[0] = 0.0f; t->snap[1] = t->snap[2] = 1.0f; @@ -5600,7 +5590,7 @@ void initTimeSlide(TransInfo *t) t->num.flag = 0; t->num.idx_max = t->idx_max; - /* initialise snap like for everything else */ + /* initialize snap like for everything else */ t->snap[0] = 0.0f; t->snap[1] = t->snap[2] = 1.0f; @@ -5742,7 +5732,7 @@ void initTimeScale(TransInfo *t) t->num.flag = 0; t->num.idx_max = t->idx_max; - /* initialise snap like for everything else */ + /* initialize snap like for everything else */ t->snap[0] = 0.0f; t->snap[1] = t->snap[2] = 1.0f; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 545d2348f82..07c90f95840 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -691,5 +691,6 @@ int getTransformOrientation(const struct bContext *C, float normal[3], float pla void freeSlideTempFaces(SlideData *sld); void freeSlideVerts(TransInfo *t); +void projectSVData(TransInfo *t, int final); #endif diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 39a89940e17..d6097615ff6 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -303,7 +303,7 @@ static void createTransTexspace(TransInfo *t) static void createTransEdge(TransInfo *t) { - BMEditMesh *em = ((Mesh *)t->obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(t->obedit); TransData *td = NULL; BMEdge *eed; BMIter iter; @@ -1095,7 +1095,7 @@ static void createTransPose(TransInfo *t, Object *ob) // BKE_report(op->reports, RPT_DEBUG, "Bone selection count error"); } - /* initialise initial auto=ik chainlen's? */ + /* initialize initial auto=ik chainlen's? */ if (ik_on) transform_autoik_update(t, 0); } @@ -2022,7 +2022,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) { ToolSettings *ts = CTX_data_tool_settings(C); TransData *tob = NULL; - BMEditMesh *em = ((Mesh *)t->obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(t->obedit); BMesh *bm = em->bm; BMVert *eve; BMIter iter; @@ -2442,7 +2442,7 @@ static void createTransUVs(bContext *C, TransInfo *t) TransData2D *td2d = NULL; MTexPoly *tf; MLoopUV *luv; - BMEditMesh *em = ((Mesh *)t->obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(t->obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -3055,7 +3055,7 @@ static TransData *ActionFCurveToTransData(TransData *td, TransData2D **td2dv, FC if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) { TimeToTransData(td, bezt->vec[1], adt); - /*set flags to move handles as necassary*/ + /*set flags to move handles as necessary*/ td->flag |= TD_MOVEHANDLE1|TD_MOVEHANDLE2; td2d->h1 = bezt->vec[0]; td2d->h2 = bezt->vec[2]; @@ -3274,7 +3274,7 @@ static void createTransActionData(bContext *C, TransInfo *t) /* ********************* GRAPH EDITOR ************************* */ -/* Helper function for createTransGraphEditData, which is reponsible for associating +/* Helper function for createTransGraphEditData, which is responsible for associating * source data with transform data */ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, BezTriple *bezt, @@ -3650,7 +3650,7 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert, const short UNUSED( } /* do we need to check if the handles need to be swapped? - * optimisation: this only needs to be performed in the first loop + * optimization: this only needs to be performed in the first loop */ if (bezm->swapHs == 0) { if ( (bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) && @@ -4356,7 +4356,7 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob) td->con= ob->constraints.first; - /* hack: tempolarily disable tracking and/or constraints when getting + /* hack: temporarily disable tracking and/or constraints when getting * object matrix, if tracking is on, or if constraints don't need * inverse correction to stop it from screwing up space conversion * matrix later @@ -4877,10 +4877,26 @@ void special_aftertrans_update(bContext *C, TransInfo *t) /* we need to delete the temporary faces before automerging */ if(t->mode == TFM_EDGE_SLIDE){ SlideData *sld = t->customData; + + /* handle multires reprojection, done + * on transform completion since it's + * really slow -joeedh */ + projectSVData(t, TRUE); + + /* free temporary faces to avoid automerging and deleting + * during cleanup - psy-fi */ freeSlideTempFaces(sld); } EDBM_automerge(t->scene, t->obedit, 1); } + else { + if (t->mode == TFM_EDGE_SLIDE) { + SlideData *sld = t->customData; + + sld->perc = 0.0; + projectSVData(t, FALSE); + } + } } } @@ -4931,7 +4947,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first; bAnimContext ac; - /* initialise relevant anim-context 'context' data */ + /* initialize relevant anim-context 'context' data */ if (ANIM_animdata_get_context(C, &ac) == 0) return; @@ -5046,7 +5062,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) bAnimContext ac; const short use_handle = !(sipo->flag & SIPO_NOHANDLES); - /* initialise relevant anim-context 'context' data */ + /* initialize relevant anim-context 'context' data */ if (ANIM_animdata_get_context(C, &ac) == 0) return; @@ -5096,7 +5112,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) else if (t->spacetype == SPACE_NLA) { bAnimContext ac; - /* initialise relevant anim-context 'context' data */ + /* initialize relevant anim-context 'context' data */ if (ANIM_animdata_get_context(C, &ac) == 0) return; @@ -5129,7 +5145,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) else if (t->obedit) { if (t->obedit->type == OB_MESH) { - BMEditMesh *em = ((Mesh *)t->obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(t->obedit); /* table needs to be created for each edit command, since vertices can move etc */ mesh_octree_table(t->obedit, em, NULL, 'e'); } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 13f45ff58b9..557a6936f2f 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -339,7 +339,7 @@ static void recalcData_actedit(TransInfo *t) bAnimListElem *ale; int filter; - /* initialise relevant anim-context 'context' data from TransInfo data */ + /* initialize relevant anim-context 'context' data from TransInfo data */ /* NOTE: sync this with the code in ANIM_animdata_get_context() */ ac.scene= t->scene; ac.obact= OBACT; @@ -389,7 +389,7 @@ static void recalcData_graphedit(TransInfo *t) int dosort = 0; - /* initialise relevant anim-context 'context' data from TransInfo data */ + /* initialize relevant anim-context 'context' data from TransInfo data */ /* NOTE: sync this with the code in ANIM_animdata_get_context() */ scene= ac.scene= t->scene; ac.obact= OBACT; @@ -500,7 +500,7 @@ static void recalcData_nla(TransInfo *t) continue; } - /* firstly, check if the proposed transform locations would overlap with any neighbouring strips + /* firstly, check if the proposed transform locations would overlap with any neighboring strips * (barring transitions) which are absolute barriers since they are not being moved * * this is done as a iterative procedure (done 5 times max for now) @@ -714,7 +714,7 @@ static void recalcData_view3d(TransInfo *t) if(la->editlatt->latt->flag & LT_OUTSIDE) outside_lattice(la->editlatt->latt); } else if (t->obedit->type == OB_MESH) { - BMEditMesh *em = ((Mesh*)t->obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(t->obedit); /* mirror modifier clipping? */ if(t->state != TRANS_CANCEL) { /* apply clipping after so we never project past the clip plane [#25423] */ @@ -727,7 +727,7 @@ static void recalcData_view3d(TransInfo *t) DAG_id_tag_update(t->obedit->data, 0); /* sets recalc flags */ EDBM_RecalcNormals(em); - BMEdit_RecalcTesselation(em); + BMEdit_RecalcTessellation(em); } else if(t->obedit->type==OB_ARMATURE) { /* no recalc flag, does pose */ bArmature *arm= t->obedit->data; @@ -1540,7 +1540,7 @@ void calculateCenter(TransInfo *t) if (t->obedit) { if (t->obedit && t->obedit->type == OB_MESH) { BMEditSelection ese; - BMEditMesh *em = ((Mesh*)t->obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(t->obedit); if (EDBM_get_actSelection(em, &ese)) { EDBM_editselection_center(em, t->center, &ese); diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index bd687ddfe40..296fea75317 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -299,7 +299,7 @@ int calc_manipulator_stats(const bContext *C) if((ob->lay & v3d->lay)==0) return 0; if(obedit->type==OB_MESH) { - BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMEditSelection ese; float vec[3]= {0,0,0}; diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index b36670bafa5..c17667cd639 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1650,7 +1650,7 @@ static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, flo if (editobject) { - em = ((Mesh *)ob->data)->edit_btmesh; + em = BMEdit_FromObject(ob); /* dm = editbmesh_get_derived_cage(scene, ob, em, CD_MASK_BAREMESH); */ dm = editbmesh_get_derived_base(ob, em); /* limitation, em & dm MUST have the same number of faces */ } @@ -1976,7 +1976,7 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L } else { - em = ((Mesh *)ob->data)->edit_btmesh; + em = BMEdit_FromObject(ob); dm = editbmesh_get_derived_cage(scene, obedit, em, CD_MASK_BAREMESH); val = peelDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, depth_peels); diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 6ab68d2261e..d3049e97f9e 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -95,7 +95,7 @@ void ED_undo_push(bContext *C, const char *str) if (U.undosteps == 0) { if (obedit->type == OB_MESH) { Mesh *me= obedit->data; - BMEdit_RecalcTesselation(me->edit_btmesh); + BMEdit_RecalcTessellation(me->edit_btmesh); } } diff --git a/source/blender/editors/uvedit/uvedit_buttons.c b/source/blender/editors/uvedit/uvedit_buttons.c index 20ff8b07bc6..a45a3555b51 100644 --- a/source/blender/editors/uvedit/uvedit_buttons.c +++ b/source/blender/editors/uvedit/uvedit_buttons.c @@ -112,17 +112,17 @@ static float uvedit_old_center[2]; static void uvedit_vertex_buttons(const bContext *C, uiBlock *block) { - SpaceImage *sima= CTX_wm_space_image(C); - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - Image *ima= sima->image; + SpaceImage *sima = CTX_wm_space_image(C); + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + Image *ima = sima->image; BMEditMesh *em; float center[2]; int imx, imy, step, digits; ED_space_image_size(sima, &imx, &imy); - em= ((Mesh *)obedit->data)->edit_btmesh; + em = BMEdit_FromObject(obedit); if(uvedit_center(scene, em, ima, center)) { copy_v2_v2(uvedit_old_center, center); @@ -161,7 +161,7 @@ static void do_uvedit_vertex(bContext *C, void *UNUSED(arg), int event) if(event != B_UVEDIT_VERTEX) return; - em= ((Mesh *)obedit->data)->edit_btmesh; + em = BMEdit_FromObject(obedit); ED_space_image_size(sima, &imx, &imy); uvedit_center(scene, em, ima, center); diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index ef09ec3c3e8..db71f74b8e1 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -132,7 +132,7 @@ static void draw_uvs_shadow(Object *obedit) BMIter iter, liter; MLoopUV *luv; - em= ((Mesh*)obedit->data)->edit_btmesh; + em = BMEdit_FromObject(obedit); /* draws the grey mesh when painting */ glColor3ub(112, 112, 112); diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 3deb4636200..42e6ec39e46 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -97,7 +97,7 @@ int ED_uvedit_test(Object *obedit) if(obedit->type != OB_MESH) return 0; - em = ((Mesh*)obedit->data)->edit_btmesh; + em = BMEdit_FromObject(obedit); ret = EDBM_texFaceCheck(em); return ret; @@ -180,7 +180,7 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im if(!obedit || (obedit->type != OB_MESH)) return; - em= ((Mesh*)obedit->data)->edit_btmesh; + em = BMEdit_FromObject(obedit); if(!em || !em->bm->totface) { return; } @@ -249,7 +249,7 @@ static int uvedit_set_tile(Object *obedit, Image *ima, int curtile) if(ima->type==IMA_TYPE_R_RESULT || ima->type==IMA_TYPE_COMPOSITE) return 0; - em= ((Mesh*)obedit->data)->edit_btmesh; + em = BMEdit_FromObject(obedit); BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); @@ -586,7 +586,7 @@ void uv_copy_aspect(float uv_orig[][2], float uv[][2], float aspx, float aspy) int ED_uvedit_minmax(Scene *scene, Image *ima, Object *obedit, float *min, float *max) { - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -616,7 +616,7 @@ int ED_uvedit_minmax(Scene *scene, Image *ima, Object *obedit, float *min, float static int ED_uvedit_median(Scene *scene, Image *ima, Object *obedit, float co[3]) { - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -868,7 +868,7 @@ void uv_find_nearest_vert(Scene *scene, Image *ima, BMEditMesh *em, int ED_uvedit_nearest_uv(Scene *scene, Object *obedit, Image *ima, float co[2], float uv[2]) { - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -1339,11 +1339,11 @@ static void weld_align_uv(bContext *C, int tool) MLoopUV *luv; float cent[2], min[2], max[2]; - scene= CTX_data_scene(C); - obedit= CTX_data_edit_object(C); - em= ((Mesh*)obedit->data)->edit_btmesh; - ima= CTX_data_edit_image(C); - sima= CTX_wm_space_image(C); + scene = CTX_data_scene(C); + obedit = CTX_data_edit_object(C); + em = BMEdit_FromObject(obedit); + ima = CTX_data_edit_image(C); + sima = CTX_wm_space_image(C); INIT_MINMAX2(min, max); @@ -1606,17 +1606,17 @@ static void select_all_perform(bContext *C, int action) MTexPoly *tf; MLoopUV *luv; - scene= CTX_data_scene(C); - ts= CTX_data_tool_settings(C); - obedit= CTX_data_edit_object(C); - em= ((Mesh*)obedit->data)->edit_btmesh; - ima= CTX_data_edit_image(C); + scene = CTX_data_scene(C); + ts = CTX_data_tool_settings(C); + obedit = CTX_data_edit_object(C); + em = BMEdit_FromObject(obedit); + ima = CTX_data_edit_image(C); if(ts->uv_flag & UV_SYNC_SELECTION) { switch (action) { case SEL_TOGGLE: - EDBM_toggle_select_all(((Mesh*)obedit->data)->edit_btmesh); + EDBM_toggle_select_all(BMEdit_FromObject(obedit)); break; case SEL_SELECT: EDBM_flag_enable_all(em, BM_ELEM_SELECT); @@ -1729,12 +1729,12 @@ static int sticky_select(float *limit, int hitv[4], int v, float *hituv[4], floa static int mouse_select(bContext *C, float co[2], int extend, int loop) { - SpaceImage *sima= CTX_wm_space_image(C); - Scene *scene= CTX_data_scene(C); - ToolSettings *ts= CTX_data_tool_settings(C); - Object *obedit= CTX_data_edit_object(C); - Image *ima= CTX_data_edit_image(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + SpaceImage *sima = CTX_wm_space_image(C); + Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); + Object *obedit = CTX_data_edit_object(C); + Image *ima = CTX_data_edit_image(C); + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -2115,12 +2115,12 @@ static void UV_OT_select_loop(wmOperatorType *ot) static int select_linked_internal(bContext *C, wmOperator *op, wmEvent *event, int pick) { - SpaceImage *sima= CTX_wm_space_image(C); - Scene *scene= CTX_data_scene(C); - ToolSettings *ts= CTX_data_tool_settings(C); - Object *obedit= CTX_data_edit_object(C); - Image *ima= CTX_data_edit_image(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + SpaceImage *sima = CTX_wm_space_image(C); + Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); + Object *obedit = CTX_data_edit_object(C); + Image *ima = CTX_data_edit_image(C); + BMEditMesh *em = BMEdit_FromObject(obedit); float limit[2]; int extend; @@ -2218,11 +2218,11 @@ static void UV_OT_select_linked_pick(wmOperatorType *ot) static int unlink_selection_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); - ToolSettings *ts= CTX_data_tool_settings(C); - Object *obedit= CTX_data_edit_object(C); - Image *ima= CTX_data_edit_image(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); + Object *obedit = CTX_data_edit_object(C); + Image *ima = CTX_data_edit_image(C); + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -2294,8 +2294,8 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje * This only needs to be done when the Mesh is not used for * selection (so for sticky modes, vertex or location based). */ - ToolSettings *ts= CTX_data_tool_settings(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + ToolSettings *ts = CTX_data_tool_settings(C); + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -2416,13 +2416,13 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje static int border_select_exec(bContext *C, wmOperator *op) { - SpaceImage *sima= CTX_wm_space_image(C); - Scene *scene= CTX_data_scene(C); - ToolSettings *ts= CTX_data_tool_settings(C); - Object *obedit= CTX_data_edit_object(C); - Image *ima= CTX_data_edit_image(C); - ARegion *ar= CTX_wm_region(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + SpaceImage *sima = CTX_wm_space_image(C); + Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); + Object *obedit = CTX_data_edit_object(C); + Image *ima = CTX_data_edit_image(C); + ARegion *ar = CTX_wm_region(C); + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -2573,11 +2573,11 @@ static void select_uv_inside_ellipse(BMEditMesh *em, SpaceImage *UNUSED(sima), S static int circle_select_exec(bContext *C, wmOperator *op) { - SpaceImage *sima= CTX_wm_space_image(C); - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; - ARegion *ar= CTX_wm_region(C); + SpaceImage *sima = CTX_wm_space_image(C); + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); + ARegion *ar = CTX_wm_region(C); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -2610,7 +2610,7 @@ static int circle_select_exec(bContext *C, wmOperator *op) } } -#if 0 //I think the BM_elem_select_set api stuff handles all this as necassary? +#if 0 //I think the BM_elem_select_set api stuff handles all this as necessary? if(select) EM_select_flush(em); else EM_deselect_flush(em); #endif @@ -2715,7 +2715,7 @@ static void UV_OT_snap_cursor(wmOperatorType *ot) static int snap_uvs_to_cursor(Scene *scene, Image *ima, Object *obedit, SpaceImage *sima) { - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -2742,7 +2742,7 @@ static int snap_uvs_to_cursor(Scene *scene, Image *ima, Object *obedit, SpaceIma static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obedit) { - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -2839,14 +2839,14 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe static int snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit) { - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; - Image *ima= sima->image; + BMEditMesh *em = BMEdit_FromObject(obedit); + Image *ima = sima->image; BMFace *efa; BMLoop *l; BMIter iter, liter; MTexPoly *tface; MLoopUV *luv; - int width= 0, height= 0; + int width = 0, height = 0; float w, h; short change = 0; @@ -2928,16 +2928,16 @@ static void UV_OT_snap_selected(wmOperatorType *ot) static int pin_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - Image *ima= CTX_data_edit_image(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + Image *ima = CTX_data_edit_image(C); + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; MTexPoly *tface; MLoopUV *luv; - int clear= RNA_boolean_get(op->ptr, "clear"); + int clear = RNA_boolean_get(op->ptr, "clear"); BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); @@ -2982,10 +2982,10 @@ static void UV_OT_pin(wmOperatorType *ot) static int select_pinned_exec(bContext *C, wmOperator *UNUSED(op)) { - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - Image *ima= CTX_data_edit_image(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + Image *ima = CTX_data_edit_image(C); + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -3027,16 +3027,16 @@ static void UV_OT_select_pinned(wmOperatorType *ot) static int hide_exec(bContext *C, wmOperator *op) { - SpaceImage *sima= CTX_wm_space_image(C); - ToolSettings *ts= CTX_data_tool_settings(C); - Object *obedit= CTX_data_edit_object(C); + SpaceImage *sima = CTX_wm_space_image(C); + ToolSettings *ts = CTX_data_tool_settings(C); + Object *obedit = CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; MLoopUV *luv; - int swap= RNA_boolean_get(op->ptr, "unselected"); + int swap = RNA_boolean_get(op->ptr, "unselected"); int facemode= sima ? sima->flag & SI_SELACTFACE : 0; if(ts->uv_flag & UV_SYNC_SELECTION) { @@ -3127,7 +3127,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); /*Scene *scene = CTX_data_scene(C);*/ /*UNUSED*/ - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 68c8669ccc7..49bfb786f20 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -4377,7 +4377,7 @@ void param_pack(ParamHandle *handle, float margin) } if(margin>0.0f) { - /* multiply the margin by the area to give predictable results not dependant on UV scale, + /* multiply the margin by the area to give predictable results not dependent on UV scale, * ...Without using the area running pack multiple times also gives a bad feedback loop. * multiply by 0.1 so the margin value from the UI can be from 0.0 to 1.0 but not give a massive margin */ margin = (margin*(float)area) * 0.1f; diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 1fc1a0c7053..c7750fd516b 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -881,7 +881,7 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final) return 1; } -/* Stitch hash initialisation functions */ +/* Stitch hash initialization functions */ static unsigned int uv_edge_hash(const void *key) { UvEdge *edge = (UvEdge *)key; @@ -985,7 +985,7 @@ static int stitch_init(bContext *C, wmOperator *op) /* initialize state */ state->use_limit = RNA_boolean_get(op->ptr, "use_limit"); state->limit_dist = RNA_float_get(op->ptr, "limit"); - state->em = em = ((Mesh *)obedit->data)->edit_btmesh; + state->em = em = BMEdit_FromObject(obedit); state->snap_islands = RNA_boolean_get(op->ptr, "snap_islands"); state->static_island = RNA_int_get(op->ptr, "static_island"); state->midpoints = RNA_boolean_get(op->ptr, "midpoint_snap"); @@ -1174,7 +1174,7 @@ static int stitch_init(bContext *C, wmOperator *op) } } - /***** initialise static island preview data *****/ + /***** initialize static island preview data *****/ state->tris_per_island = MEM_mallocN(sizeof(*state->tris_per_island)*state->element_map->totalIslands, "stitch island tris"); diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 7233efef20f..56d088577b6 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -88,8 +88,8 @@ static int ED_uvedit_ensure_uvs(bContext *C, Scene *scene, Object *obedit) { - Main *bmain= CTX_data_main(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Main *bmain = CTX_data_main(C); + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMIter iter; Image *ima; @@ -345,7 +345,7 @@ static void texface_from_original_index(BMFace *efa, int index, float **uv, Para } } -/* unwrap handle initialisation for subsurf aware-unwrapper. The many modifications required to make the original function(see above) +/* unwrap handle initialization for subsurf aware-unwrapper. The many modifications required to make the original function(see above) * work justified the existence of a new function. */ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, BMEditMesh *em, short fill, short sel, short correct_aspect) { @@ -356,7 +356,7 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, BMEditMesh *e BMFace *editFace; int i; - /* modifier initialisation data, will control what type of subdivision will happen*/ + /* modifier initialization data, will control what type of subdivision will happen*/ SubsurfModifierData smd = {{0}}; /* Used to hold subsurfed Mesh */ DerivedMesh *derivedMesh, *initialDerived; @@ -509,12 +509,12 @@ typedef struct MinStretch { static int minimize_stretch_init(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); MinStretch *ms; - int fill_holes= RNA_boolean_get(op->ptr, "fill_holes"); - short implicit= 1; + int fill_holes = RNA_boolean_get(op->ptr, "fill_holes"); + short implicit = 1; if(!uvedit_have_selection(scene, em, implicit)) { return 0; @@ -706,11 +706,11 @@ void UV_OT_minimize_stretch(wmOperatorType *ot) static int pack_islands_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); ParamHandle *handle; - short implicit= 1; + short implicit = 1; if(!uvedit_have_selection(scene, em, implicit)) { return OPERATOR_CANCELLED; @@ -753,11 +753,11 @@ void UV_OT_pack_islands(wmOperatorType *ot) static int average_islands_scale_exec(bContext *C, wmOperator *UNUSED(op)) { - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); ParamHandle *handle; - short implicit= 1; + short implicit = 1; if(!uvedit_have_selection(scene, em, implicit)) { return OPERATOR_CANCELLED; @@ -792,7 +792,7 @@ static ParamHandle *liveHandle = NULL; void ED_uvedit_live_unwrap_begin(Scene *scene, Object *obedit) { - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); short abf = scene->toolsettings->unwrapper == 0; short fillholes = scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES; short use_subsurf = scene->toolsettings->uvcalc_flag & UVCALC_USESUBSURF; @@ -930,11 +930,11 @@ static void uv_map_rotation_matrix(float result[][4], RegionView3D *rv3d, Object static void uv_map_transform(bContext *C, wmOperator *op, float center[3], float rotmat[4][4]) { /* context checks are messy here, making it work in both 3d view and uv editor */ - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; - View3D *v3d= CTX_wm_view3d(C); - RegionView3D *rv3d= CTX_wm_region_view3d(C); + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); + View3D *v3d = CTX_wm_view3d(C); + RegionView3D *rv3d = CTX_wm_region_view3d(C); /* common operator properties */ int align= RNA_enum_get(op->ptr, "align"); int direction= RNA_enum_get(op->ptr, "direction"); @@ -1112,7 +1112,7 @@ static void uv_map_clip_correct(BMEditMesh *em, wmOperator *op) /* assumes UV Map is checked, doesn't run update funcs */ void ED_unwrap_lscm(Scene *scene, Object *obedit, const short sel) { - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + BMEditMesh *em = BMEdit_FromObject(obedit); ParamHandle *handle; const short fill_holes= scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES; @@ -1137,9 +1137,9 @@ void ED_unwrap_lscm(Scene *scene, Object *obedit, const short sel) static int unwrap_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); int method = RNA_enum_get(op->ptr, "method"); int fill_holes = RNA_boolean_get(op->ptr, "fill_holes"); int correct_aspect = RNA_boolean_get(op->ptr, "correct_aspect"); @@ -1217,13 +1217,13 @@ void UV_OT_unwrap(wmOperatorType *ot) /**************** Project From View operator **************/ static int uv_from_view_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - Camera *camera= NULL; - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + Camera *camera = NULL; + BMEditMesh *em = BMEdit_FromObject(obedit); ARegion *ar = CTX_wm_region(C); - View3D *v3d= CTX_wm_view3d(C); - RegionView3D *rv3d= CTX_wm_region_view3d(C); + View3D *v3d = CTX_wm_view3d(C); + RegionView3D *rv3d = CTX_wm_region_view3d(C); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -1403,9 +1403,9 @@ static void uv_map_mirror(BMEditMesh *em, BMFace *efa, MTexPoly *UNUSED(tf)) static int sphere_project_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -1476,9 +1476,9 @@ static void uv_cylinder_project(float target[2], float source[3], float center[3 static int cylinder_project_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; @@ -1535,9 +1535,9 @@ void UV_OT_cylinder_project(wmOperatorType *ot) static int cube_project_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; + Scene *scene = CTX_data_scene(C); + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); BMFace *efa; BMLoop *l; BMIter iter, liter; diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index dfbb243aa7a..8129b27a66e 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -179,7 +179,7 @@ void GPU_extensions_init(void) GG.npotdisabled = 1; } - /* make sure double side isn't used by defautl and only getting enabled in places where it's + /* make sure double side isn't used by default and only getting enabled in places where it's * really needed to prevent different unexpected behaviors like with intel gme965 card (sergey) */ glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp index 51f68d819d4..42a3aace775 100644 --- a/source/blender/ikplugin/intern/itasc_plugin.cpp +++ b/source/blender/ikplugin/intern/itasc_plugin.cpp @@ -268,7 +268,7 @@ static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *co if (curchan->iktree.first != NULL) // Oh oh, there is already a chain starting from this channel and our chain is longer... - // Should handle this by moving the previous chain up to the begining of our chain + // Should handle this by moving the previous chain up to the beginning of our chain // For now we just stop here break; } diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 4c8a79e6372..649b7cb1c11 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -104,6 +104,10 @@ set(SRC if(WITH_IMAGE_OPENEXR) add_definitions(-DWITH_OPENEXR) +else() + list(APPEND SRC + intern/openexr/openexr_stub.cpp + ) endif() if(WITH_IMAGE_TIFF) diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index ee1580a3135..c96b0509a27 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -30,23 +30,22 @@ */ /** - * @file IMB_imbuf.h - * @brief IMage Buffer module. + * \brief IMage Buffer module. * * This module offers import/export of several graphical file formats. - * @ingroup imbuf + * \ingroup imbuf * - * @page IMB Imbuf module external interface + * \page IMB Imbuf module external interface * * - * @section about About the IMB module + * \section about About the IMB module * * External interface of the IMage Buffer module. This module offers * import/export of several graphical file formats. It offers the * ImBuf type as a common structure to refer to different graphical * file formats, and to enable a uniform way of handling them. * - * @section issues Known issues with IMB + * \section issues Known issues with IMB * * - imbuf is written in C. * - Endianness issues are dealt with internally. @@ -56,7 +55,7 @@ * amiga and Irix are present. A 'posix-compliancy-patch' * provides the interface to windows. * - * @section dependencies Dependencies + * \section dependencies Dependencies * * IMB needs: * - \ref DNA module @@ -73,51 +72,51 @@ /** * - * @attention defined in ??? + * \attention defined in ??? */ struct ImBuf; /** * - * @attention defined in ??? + * \attention defined in ??? */ struct anim; /** * - * @attention Defined in allocimbuf.c + * \attention Defined in allocimbuf.c */ void IMB_init(void); void IMB_exit(void); /** * - * @attention Defined in readimage.c + * \attention Defined in readimage.c */ struct ImBuf *IMB_ibImageFromMemory(unsigned char *mem, size_t size, int flags, const char *descr); /** * - * @attention Defined in readimage.c + * \attention Defined in readimage.c */ struct ImBuf *IMB_testiffname(const char *filepath, int flags); /** * - * @attention Defined in readimage.c + * \attention Defined in readimage.c */ struct ImBuf *IMB_loadiffname(const char *filepath, int flags); /** * - * @attention Defined in allocimbuf.c + * \attention Defined in allocimbuf.c */ void IMB_freeImBuf(struct ImBuf *ibuf); /** * - * @attention Defined in allocimbuf.c + * \attention Defined in allocimbuf.c */ struct ImBuf *IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char d, unsigned int flags); @@ -128,7 +127,7 @@ struct ImBuf *IMB_allocImBuf(unsigned int x, unsigned int y, * (to delete an imbuf you have to call freeImBuf as many times as it * is referenced) * - * @attention Defined in allocimbuf.c + * \attention Defined in allocimbuf.c */ void IMB_refImBuf(struct ImBuf *ibuf); @@ -136,20 +135,20 @@ struct ImBuf * IMB_makeSingleUser(struct ImBuf *ibuf); /** * - * @attention Defined in allocimbuf.c + * \attention Defined in allocimbuf.c */ struct ImBuf *IMB_dupImBuf(struct ImBuf *ibuf1); /** * - * @attention Defined in allocimbuf.c + * \attention Defined in allocimbuf.c */ short addzbufImBuf(struct ImBuf *ibuf); short addzbuffloatImBuf(struct ImBuf *ibuf); /** * - * @attention Defined in rectop.c + * \attention Defined in rectop.c */ typedef enum IMB_BlendMode { @@ -181,7 +180,7 @@ void IMB_rectblend(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx, /** * - * @attention Defined in indexer.c + * \attention Defined in indexer.c */ typedef enum IMB_Timecode_Type { @@ -231,7 +230,7 @@ void IMB_anim_index_rebuild(struct IndexBuildContext *context, void IMB_anim_index_rebuild_finish(struct IndexBuildContext *context, short stop); /** - * Return the length (in frames) of the given @a anim. + * Return the length (in frames) of the given \a anim. */ int IMB_anim_get_duration(struct anim *anim, IMB_Timecode_Type tc); @@ -245,7 +244,7 @@ int IMB_anim_get_fps(struct anim * anim, /** * - * @attention Defined in anim_movie.c + * \attention Defined in anim_movie.c */ struct anim *IMB_open_anim(const char *name, int ib_flags, int streamindex); void IMB_close_anim(struct anim *anim); @@ -254,7 +253,7 @@ void IMB_close_anim_proxies(struct anim *anim); /** * - * @attention Defined in anim_movie.c + * \attention Defined in anim_movie.c */ int ismovie(const char *filepath); @@ -263,7 +262,7 @@ int IMB_anim_get_preseek(struct anim *anim); /** * - * @attention Defined in anim_movie.c + * \attention Defined in anim_movie.c */ struct ImBuf *IMB_anim_absolute( @@ -273,20 +272,20 @@ struct ImBuf *IMB_anim_absolute( /** * - * @attention Defined in anim_movie.c + * \attention Defined in anim_movie.c * fetches a define previewframe, usually half way into the movie */ struct ImBuf *IMB_anim_previewframe(struct anim *anim); /** * - * @attention Defined in anim_movie.c + * \attention Defined in anim_movie.c */ void IMB_free_anim(struct anim *anim); /** * - * @attention Defined in filter.c + * \attention Defined in filter.c */ #define FILTER_MASK_NULL 0 @@ -304,7 +303,7 @@ struct ImBuf *IMB_getmipmap(struct ImBuf *ibuf, int level); /** * - * @attention Defined in cache.c + * \attention Defined in cache.c */ void IMB_tile_cache_params(int totthread, int maxmem); @@ -313,55 +312,55 @@ void IMB_tiles_to_rect(struct ImBuf *ibuf); /** * - * @attention Defined in filter.c + * \attention Defined in filter.c */ void IMB_filtery(struct ImBuf *ibuf); /** * - * @attention Defined in scaling.c + * \attention Defined in scaling.c */ struct ImBuf *IMB_onehalf(struct ImBuf *ibuf1); /** * - * @attention Defined in scaling.c + * \attention Defined in scaling.c */ struct ImBuf *IMB_scaleImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy); /** * - * @attention Defined in scaling.c + * \attention Defined in scaling.c */ struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy); /** * - * @attention Defined in writeimage.c + * \attention Defined in writeimage.c */ short IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags); /** * - * @attention Defined in util.c + * \attention Defined in util.c */ int IMB_ispic(const char *name); /** * - * @attention Defined in util.c + * \attention Defined in util.c */ int IMB_isanim(const char *name); /** * - * @attention Defined in util.c + * \attention Defined in util.c */ int imb_get_anim_type(const char *name); /** * - * @attention Defined in divers.c + * \attention Defined in divers.c */ void IMB_de_interlace(struct ImBuf *ibuf); void IMB_interlace(struct ImBuf *ibuf); @@ -397,13 +396,13 @@ void IMB_buffer_float_clamp(float *buf, int width, int height); * Change the ordering of the color bytes pointed to by rect from * rgba to abgr. size * 4 color bytes are reordered. * - * @attention Defined in imageprocess.c + * \attention Defined in imageprocess.c */ void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf); /** * - * @attention defined in imageprocess.c + * \attention defined in imageprocess.c */ void bicubic_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float v, int xout, int yout); void neareast_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float v, int xout, int yout); @@ -416,51 +415,51 @@ void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char *col, flo /** * - * @attention defined in readimage.c - * @deprecated Only here for backwards compatibility of the - * @deprecated plugin system. + * \attention defined in readimage.c + * \deprecated Only here for backwards compatibility of the + * \deprecated plugin system. */ struct ImBuf *IMB_loadifffile(int file, int flags, const char *descr); /** * - * @attention defined in scaling.c + * \attention defined in scaling.c */ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1); /** * - * @attention defined in scaling.c + * \attention defined in scaling.c */ struct ImBuf *IMB_double_fast_x(struct ImBuf *ibuf1); /** * - * @attention defined in scaling.c + * \attention defined in scaling.c */ struct ImBuf *IMB_double_x(struct ImBuf *ibuf1); /** * - * @attention defined in scaling.c + * \attention defined in scaling.c */ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1); /** * - * @attention defined in scaling.c + * \attention defined in scaling.c */ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1); /** * - * @attention defined in scaling.c + * \attention defined in scaling.c */ struct ImBuf *IMB_double_y(struct ImBuf *ibuf1); /** * - * @attention Defined in rotate.c + * \attention Defined in rotate.c */ void IMB_flipx(struct ImBuf *ibuf); void IMB_flipy(struct ImBuf *ibuf); @@ -471,14 +470,14 @@ void IMB_premultiply_alpha(struct ImBuf *ibuf); /** * - * @attention Defined in allocimbuf.c + * \attention Defined in allocimbuf.c */ void IMB_freezbufImBuf(struct ImBuf *ibuf); void IMB_freezbuffloatImBuf(struct ImBuf *ibuf); /** * - * @attention Defined in rectop.c + * \attention Defined in rectop.c */ void IMB_rectfill(struct ImBuf *drect, const float col[4]); void IMB_rectfill_area(struct ImBuf *ibuf, float *col, int x1, int y1, int x2, int y2); diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index eae9665d23b..ca56003845f 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -20,6 +20,8 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): if env['WITH_BF_OPENEXR']: defs.append('WITH_OPENEXR') +else: + sources.append(os.path.join('intern', 'openexr', 'openexr_stub.cpp')) if env['WITH_BF_TIFF']: defs.append('WITH_TIFF') diff --git a/source/blender/imbuf/intern/IMB_metadata.h b/source/blender/imbuf/intern/IMB_metadata.h index 3ae1015d6af..8211896b185 100644 --- a/source/blender/imbuf/intern/IMB_metadata.h +++ b/source/blender/imbuf/intern/IMB_metadata.h @@ -55,28 +55,28 @@ typedef struct ImMetaData { void IMB_metadata_free(struct ImBuf* img); /** read the field from the image info into the field - * @param img - the ImBuf that contains the image data - * @param key - the key of the field - * @param value - the data in the field, first one found with key is returned, + * \param img - the ImBuf that contains the image data + * \param key - the key of the field + * \param value - the data in the field, first one found with key is returned, memory has to be allocated by user. - * @param len - length of value buffer allocated by user. - * @return - 1 (true) if ImageInfo present and value for the key found, 0 (false) otherwise + * \param len - length of value buffer allocated by user. + * \return - 1 (true) if ImageInfo present and value for the key found, 0 (false) otherwise */ int IMB_metadata_get_field(struct ImBuf* img, const char* key, char* value, int len); /** set user data in the ImMetaData struct, which has to be allocated with IMB_metadata_create * before calling this function. - * @param img - the ImBuf that contains the image data - * @param key - the key of the field - * @param value - the data to be written to the field. zero terminated string - * @return - 1 (true) if ImageInfo present, 0 (false) otherwise + * \param img - the ImBuf that contains the image data + * \param key - the key of the field + * \param value - the data to be written to the field. zero terminated string + * \return - 1 (true) if ImageInfo present, 0 (false) otherwise */ int IMB_metadata_add_field(struct ImBuf* img, const char* key, const char* value); /** delete the key/field par in the ImMetaData struct. - * @param img - the ImBuf that contains the image data - * @param key - the key of the field - * @return - 1 (true) if delete the key/field, 0 (false) otherwise + * \param img - the ImBuf that contains the image data + * \param key - the key of the field + * \return - 1 (true) if delete the key/field, 0 (false) otherwise */ int IMB_metadata_del_field(struct ImBuf *img, const char *key); diff --git a/source/blender/imbuf/intern/dds/PixelFormat.h b/source/blender/imbuf/intern/dds/PixelFormat.h index 9add62c4616..3c5cb34812c 100644 --- a/source/blender/imbuf/intern/dds/PixelFormat.h +++ b/source/blender/imbuf/intern/dds/PixelFormat.h @@ -63,7 +63,7 @@ namespace PixelFormat { - // Convert component @a c having @a inbits to the returned value having @a outbits. + // Convert component \a c having \a inbits to the returned value having \a outbits. inline uint convert(uint c, uint inbits, uint outbits) { if (inbits == 0) diff --git a/source/blender/imbuf/intern/imbuf_cocoa.m b/source/blender/imbuf/intern/imbuf_cocoa.m index b79b1358ec2..db7f93423cb 100644 --- a/source/blender/imbuf/intern/imbuf_cocoa.m +++ b/source/blender/imbuf/intern/imbuf_cocoa.m @@ -53,12 +53,12 @@ * Loads any Core Graphics supported type * Currently is : TIFF, BMP, JPEG, GIF, PNG, DIB, ICO, and various RAW formats * - * @param mem: Memory containing the bitmap image - * @param size: Size of the mem buffer. - * @param flags: If flags has IB_test set then the file is not actually loaded, + * \param mem: Memory containing the bitmap image + * \param size: Size of the mem buffer. + * \param flags: If flags has IB_test set then the file is not actually loaded, * but all other operations take place. * - * @return: A newly allocated ImBuf structure if successful, otherwise NULL. + * \return: A newly allocated ImBuf structure if successful, otherwise NULL. */ struct ImBuf *imb_cocoaLoadImage(unsigned char *mem, int size, int flags) { @@ -197,11 +197,11 @@ struct ImBuf *imb_cocoaLoadImage(unsigned char *mem, int size, int flags) * * Accepted formats: TIFF, GIF, BMP, PNG, JPEG, JPEG2000 * - * @param ibuf: Image buffer. - * @param name: Name of the image file to create. - * @param flags: Currently largely ignored. + * \param ibuf: Image buffer. + * \param name: Name of the image file to create. + * \param flags: Currently largely ignored. * - * @return: 1 if the function is successful, 0 on failure. + * \return: 1 if the function is successful, 0 on failure. */ #define FTOUSHORT(val) ((val >= 1.0f-0.5f/65535)? 65535: (val <= 0.0f)? 0: (unsigned short)(val*65535.0f + 0.5f)) diff --git a/source/blender/imbuf/intern/moviecache.c b/source/blender/imbuf/intern/moviecache.c index fd0a0372a9c..67d9a602d12 100644 --- a/source/blender/imbuf/intern/moviecache.c +++ b/source/blender/imbuf/intern/moviecache.c @@ -204,9 +204,9 @@ struct MovieCache *IMB_moviecache_create(int keysize, GHashHashFP hashfp, GHashC MovieCache *cache; cache= MEM_callocN(sizeof(MovieCache), "MovieCache"); - cache->keys_pool= BLI_mempool_create(sizeof(MovieCacheKey), 64, 64, FALSE, FALSE); - cache->items_pool= BLI_mempool_create(sizeof(MovieCacheItem), 64, 64, FALSE, FALSE); - cache->userkeys_pool= BLI_mempool_create(keysize, 64, 64, FALSE, FALSE); + cache->keys_pool= BLI_mempool_create(sizeof(MovieCacheKey), 64, 64, 0); + cache->items_pool= BLI_mempool_create(sizeof(MovieCacheItem), 64, 64, 0); + cache->userkeys_pool= BLI_mempool_create(keysize, 64, 64, 0); cache->hash= BLI_ghash_new(moviecache_hashhash, moviecache_hashcmp, "MovieClip ImBuf cache hash"); cache->keysize= keysize; diff --git a/source/blender/imbuf/intern/openexr/openexr_api.h b/source/blender/imbuf/intern/openexr/openexr_api.h index 2b3a17ba47d..0d51461c2e8 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.h +++ b/source/blender/imbuf/intern/openexr/openexr_api.h @@ -41,7 +41,7 @@ extern "C" { /** * Test presence of OpenEXR file. - * @param mem pointer to loaded OpenEXR bitstream + * \param mem pointer to loaded OpenEXR bitstream */ int imb_is_a_openexr (unsigned char *mem); diff --git a/source/blender/imbuf/intern/openexr/openexr_multi.h b/source/blender/imbuf/intern/openexr/openexr_multi.h index 84e3da0baa7..cb18ddd219b 100644 --- a/source/blender/imbuf/intern/openexr/openexr_multi.h +++ b/source/blender/imbuf/intern/openexr/openexr_multi.h @@ -43,7 +43,10 @@ #define EXR_PASS_MAXCHAN 8 -#ifdef WITH_OPENEXR +#ifdef __cplusplus +extern "C" { +#endif + void * IMB_exr_get_handle (void); void IMB_exr_add_channel (void *handle, const char *layname, const char *passname, int xstride, int ystride, float *rect); @@ -64,36 +67,8 @@ void IMB_exr_multilayer_convert (void *handle, void *base, void IMB_exr_close (void *handle); - -#else - -/* ugly... but we only use it on pipeline.c, render module, now */ - -void * IMB_exr_get_handle (void) {return NULL;} -void IMB_exr_add_channel (void *handle, const char *layname, const char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; } - -int IMB_exr_begin_read (void *handle, const char *filename, int *width, int *height) { (void)handle; (void)filename; (void)width; (void)height; return 0;} -int IMB_exr_begin_write (void *handle, const char *filename, int width, int height, int compress) { (void)handle; (void)filename; (void)width; (void)height; (void)compress; return 0;} -void IMB_exrtile_begin_write (void *handle, const char *filename, int mipmap, int width, int height, int tilex, int tiley) { (void)handle; (void)filename; (void)mipmap; (void)width; (void)height; (void)tilex; (void)tiley; } - -void IMB_exr_set_channel (void *handle, char *layname, const char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; } - -void IMB_exr_read_channels (void *handle) { (void)handle; } -void IMB_exr_write_channels (void *handle) { (void)handle; } -void IMB_exrtile_write_channels (void *handle, int partx, int party, int level) { (void)handle; (void)partx; (void)party; (void)level; } -void IMB_exrtile_clear_channels (void *handle) { (void)handle; } - -void IMB_exr_multilayer_convert (void *handle, void *base, - void * (*addlayer)(void *base, char *str), - void (*addpass)(void *base, void *lay, char *str, float *rect, int totchan, char *chan_id)) - { - (void)handle; (void)base; (void)addlayer; (void)addpass; - } - -void IMB_exr_close (void *handle) { (void)handle; } - +#ifdef __cplusplus +} // extern "C" #endif - - #endif /* __OPENEXR_MULTI_H */ diff --git a/source/blender/imbuf/intern/openexr/openexr_stub.cpp b/source/blender/imbuf/intern/openexr/openexr_stub.cpp new file mode 100644 index 00000000000..29b12a2984b --- /dev/null +++ b/source/blender/imbuf/intern/openexr/openexr_stub.cpp @@ -0,0 +1,58 @@ +/** \file blender/imbuf/intern/openexr/openexr_stub.cpp + * \ingroup openexr + */ +/* +* + * ***** BEGIN GPLLICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright by Gernot Ziegler <gz@lysator.liu.se>. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Austin Benesh, Ton Roosendaal (float, half, speedup, cleanup...). + * + * ***** END GPL LICENSE BLOCK ***** + */ + + +#include "openexr_api.h" +#include "openexr_multi.h" + + +void * IMB_exr_get_handle (void) {return NULL;} +void IMB_exr_add_channel (void *handle, const char *layname, const char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; } + +int IMB_exr_begin_read (void *handle, const char *filename, int *width, int *height) { (void)handle; (void)filename; (void)width; (void)height; return 0;} +int IMB_exr_begin_write (void *handle, const char *filename, int width, int height, int compress) { (void)handle; (void)filename; (void)width; (void)height; (void)compress; return 0;} +void IMB_exrtile_begin_write (void *handle, const char *filename, int mipmap, int width, int height, int tilex, int tiley) { (void)handle; (void)filename; (void)mipmap; (void)width; (void)height; (void)tilex; (void)tiley; } + +void IMB_exr_set_channel (void *handle, const char *layname, const char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; } + +void IMB_exr_read_channels (void *handle) { (void)handle; } +void IMB_exr_write_channels (void *handle) { (void)handle; } +void IMB_exrtile_write_channels (void *handle, int partx, int party, int level) { (void)handle; (void)partx; (void)party; (void)level; } +void IMB_exrtile_clear_channels (void *handle) { (void)handle; } + +void IMB_exr_multilayer_convert (void *handle, void *base, + void * (*addlayer)(void *base, char *str), + void (*addpass)(void *base, void *lay, char *str, float *rect, int totchan, char *chan_id)) + { + (void)handle; (void)base; (void)addlayer; (void)addpass; + } + +void IMB_exr_close (void *handle) { (void)handle; } diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 6fe2a3b8bc2..afc64e1a528 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -113,11 +113,11 @@ static int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) /** * Reads data from an in-memory TIFF file. * - * @param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile). - * @param data: Buffer to contain data (treat as void*). - * @param n: Number of bytes to read. + * \param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile). + * \param data: Buffer to contain data (treat as void*). + * \param n: Number of bytes to read. * - * @return: Number of bytes actually read. + * \return: Number of bytes actually read. * 0 = EOF. */ static tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n) @@ -177,15 +177,15 @@ static tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n) /** * Seeks to a new location in an in-memory TIFF file. * - * @param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile). - * @param ofs: Offset value (interpreted according to whence below). - * @param whence: This can be one of three values: + * \param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile). + * \param ofs: Offset value (interpreted according to whence below). + * \param whence: This can be one of three values: * SEEK_SET - The offset is set to ofs bytes. * SEEK_CUR - The offset is set to its current location plus ofs bytes. * SEEK_END - (This is unsupported and will return -1, indicating an * error). * - * @return: Resulting offset location within the file, measured in bytes from + * \return: Resulting offset location within the file, measured in bytes from * the beginning of the file. (-1) indicates an error. */ static toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence) @@ -231,9 +231,9 @@ static toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence) * are made to access the file after that point. However, no such * attempts should ever be made (in theory). * - * @param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile). + * \param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile). * - * @return: 0 + * \return: 0 */ static int imb_tiff_CloseProc(thandle_t handle) { @@ -259,7 +259,7 @@ static int imb_tiff_CloseProc(thandle_t handle) /** * Returns the size of an in-memory TIFF file in bytes. * - * @return: Size of file (in bytes). + * \return: Size of file (in bytes). */ static toff_t imb_tiff_SizeProc(thandle_t handle) { @@ -495,12 +495,12 @@ void imb_inittiff(void) * Loads a TIFF file. * * - * @param mem: Memory containing the TIFF file. - * @param size: Size of the mem buffer. - * @param flags: If flags has IB_test set then the file is not actually loaded, + * \param mem: Memory containing the TIFF file. + * \param size: Size of the mem buffer. + * \param flags: If flags has IB_test set then the file is not actually loaded, * but all other operations take place. * - * @return: A newly allocated ImBuf structure if successful, otherwise NULL. + * \return: A newly allocated ImBuf structure if successful, otherwise NULL. */ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags) { @@ -661,11 +661,11 @@ void imb_loadtiletiff(ImBuf *ibuf, unsigned char *mem, size_t size, int tx, int * Blender by setting "Premul" alpha handling. Other alpha conventions are * not strictly correct, but are permitted anyhow. * - * @param ibuf: Image buffer. - * @param name: Name of the TIFF file to create. - * @param flags: Currently largely ignored. + * \param ibuf: Image buffer. + * \param name: Name of the TIFF file to create. + * \param flags: Currently largely ignored. * - * @return: 1 if the function is successful, 0 on failure. + * \return: 1 if the function is successful, 0 on failure. */ int imb_savetiff(ImBuf *ibuf, const char *name, int flags) diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index ae31bea4981..0f62348f418 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -559,7 +559,7 @@ typedef struct NlaStrip { ListBase strips; /* 'Child' strips (used for 'meta' strips) */ bAction *act; /* Action that is referenced by this strip (strip is 'user' of the action) */ - AnimMapper *remap; /* Remapping info this strip (for tweaking correspondance of action with context) */ + AnimMapper *remap; /* Remapping info this strip (for tweaking correspondence of action with context) */ ListBase fcurves; /* F-Curves for controlling this strip's influence and timing */ // TODO: move out? ListBase modifiers; /* F-Curve modifiers to be applied to the entire strip's referenced F-Curves */ @@ -752,7 +752,7 @@ typedef enum eKSP_Grouping { * be keyframed together, providing a convenient way for animators * to insert keyframes without resorting to Auto-Keyframing. * - * A few 'generic' (non-absolute and dependant on templates) KeyingSets + * A few 'generic' (non-absolute and dependent on templates) KeyingSets * are defined 'built-in' to facilitate easy animating for the casual * animator without the need to add extra steps to the rigging process. */ diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h index 4618b99f6b6..cdf20bd726a 100644 --- a/source/blender/makesdna/DNA_camera_types.h +++ b/source/blender/makesdna/DNA_camera_types.h @@ -58,7 +58,7 @@ typedef struct Camera { float shiftx, shifty; /* yafray: dof params */ - /* qdn: yafray var 'YF_dofdist' now enabled for defocus composit node as well. + /* qdn: yafray var 'YF_dofdist' now enabled for defocus composite node as well. The name was not changed so that no other files need to be modified */ float YF_dofdist; diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index d5b9477f7f6..e311b6dffea 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -125,7 +125,7 @@ typedef struct Nurb { short mat_nr; /* index into material list */ short hide, flag; short pntsu, pntsv; /* number of points in the U or V directions */ - short resolu, resolv; /* tesselation resolution in the U or V directions */ + short resolu, resolv; /* tessellation resolution in the U or V directions */ short orderu, orderv; short flagu, flagv; diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index ebcf86c9178..f3dce52d784 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -168,7 +168,7 @@ typedef struct Material { float sss_front, sss_back; short sss_flag, sss_preset; - int mapto_textured; /* render-time cache to optimise texture lookups */ + int mapto_textured; /* render-time cache to optimize texture lookups */ short shadowonly_flag; /* "shadowsonly" type */ short index; /* custom index for render passes */ diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index bb1f17010bb..be7ada5c5f1 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -77,10 +77,10 @@ typedef struct Mesh { struct MLoopCol *mloopcol; /* END BMESH ONLY */ - /*mface stores the tesselation (triangulation) of the mesh, + /*mface stores the tessellation (triangulation) of the mesh, real faces are now stored in nface.*/ - struct MFace *mface; /* array of mesh object mode faces for tesselation */ - struct MTFace *mtface; /* store tesselation face UV's and texture here */ + struct MFace *mface; /* array of mesh object mode faces for tessellation */ + struct MTFace *mtface; /* store tessellation face UV's and texture here */ struct TFace *tface; /* depecrated, use mtface */ struct MVert *mvert; /* array of verts */ struct MEdge *medge; /* array of edges */ diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index 53f9ff101a3..d7be7c0bff6 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -38,7 +38,7 @@ struct Bone; struct Image; -/*tesselation face, see MLoop/MPoly for the real face data*/ +/*tessellation face, see MLoop/MPoly for the real face data*/ typedef struct MFace { unsigned int v1, v2, v3, v4; short mat_nr; @@ -68,7 +68,7 @@ typedef struct MVert { char flag, bweight; } MVert; -/* tesselation vertex color data. +/* tessellation vertex color data. * at the moment alpha is abused for vertex painting * and not used for transparency, note that red and blue are swapped */ typedef struct MCol { @@ -76,7 +76,7 @@ typedef struct MCol { } MCol; /*new face structure, replaces MFace, which is now - only used for storing tesselations.*/ + only used for storing tessellations.*/ typedef struct MPoly { /* offset into loop array and number of loops in the face */ int loopstart; @@ -134,7 +134,7 @@ typedef struct MSelect { int type; /* EDITVERT/EDITEDGE/EDITFACE */ } MSelect; -/*tesselation uv face data*/ +/*tessellation uv face data*/ typedef struct MTFace { float uv[4][2]; struct Image *tpage; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index c0cda33f8d8..a848c3edd49 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -809,12 +809,6 @@ typedef struct OceanModifierData { #define MOD_OCEAN_GENERATE_NORMALS 2 -/* BMESH_ONLY */ -typedef struct NgonInterpModifierData { - ModifierData modifier; - int resolution, pad0; -} NgonInterpModifierData; - typedef struct WarpModifierData { ModifierData modifier; /* keep in sync with MappingInfoModifierData */ diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 93891a9edfa..f0d0a556d92 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -114,7 +114,7 @@ typedef struct bNodeSocket { /* sock->struct_type */ #define SOCK_STRUCT_NONE 0 /* default, type is defined by sock->type only */ -#define SOCK_STRUCT_OUTPUT_MULTI_FILE 1 /* multi file output node socket */ +#define SOCK_STRUCT_OUTPUT_FILE 1 /* file output node socket */ /* socket side (input/output) */ #define SOCK_IN 1 @@ -358,14 +358,17 @@ typedef struct NodeImageFile { int sfra, efra; } NodeImageFile; +/* XXX first struct fields should match NodeImageFile to ensure forward compatibility */ typedef struct NodeImageMultiFile { char base_path[1024]; /* 1024 = FILE_MAX */ + ImageFormatData format; + int sfra DNA_DEPRECATED, efra DNA_DEPRECATED; /* XXX old frame rand values from NodeImageFile for forward compatibility */ int active_input; /* selected input in details view list */ int pad; } NodeImageMultiFile; typedef struct NodeImageMultiFileSocket { - short use_render_format; /* use global render settings instead of own format */ - short pad1; + short use_render_format DNA_DEPRECATED; + short use_node_format; /* use overall node image format */ int pad2; ImageFormatData format; } NodeImageMultiFileSocket; diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 83307cc2fc6..d3f8c65995a 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -353,7 +353,7 @@ typedef struct DupliObject { #define OB_NO_CONSTRAINTS 8192 /* runtime constraints disable */ /* (short) ipoflag */ -/* XXX: many old flags for features removed due to incompatability +/* XXX: many old flags for features removed due to incompatibility * with new system and/or other design issues were here */ /* for stride/path editing (XXX: NEEDS REVIEW) */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 772f28450ed..2564046bb87 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1091,7 +1091,7 @@ typedef struct Scene { void *fps_info; /* (runtime) info/cache used for presenting playback framerate info to the user */ - /* none of the dependancy graph vars is mean to be saved */ + /* none of the dependency graph vars is mean to be saved */ struct DagForest *theDag; short dagisvalid, dagflags; short recalc; /* recalc = counterpart of ob->recalc */ diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index c6ffec2aff7..c026c2018fd 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -97,9 +97,9 @@ typedef struct MTex { #ifndef DNA_USHORT_FIX #define DNA_USHORT_FIX /** - * @deprecated This typedef serves to avoid badly typed functions when - * @deprecated compiling while delivering a proper dna.c. Do not use - * @deprecated it in any case. + * \deprecated This typedef serves to avoid badly typed functions when + * \deprecated compiling while delivering a proper dna.c. Do not use + * \deprecated it in any case. */ typedef unsigned short dna_ushort_fix; #endif @@ -232,7 +232,7 @@ typedef struct Tex { /* newnoise: distorted noise amount, musgrave & voronoi ouput scale */ float dist_amount, ns_outscale; - /* newnoise: voronoi nearest neighbour weights, minkovsky exponent, distance metric & color type */ + /* newnoise: voronoi nearest neighbor weights, minkovsky exponent, distance metric & color type */ float vn_w1; float vn_w2; float vn_w3; diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 9c2289b2edd..a332c77c402 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -122,7 +122,7 @@ IMPORTANT: - do not use #defines in structs for array lengths, this cannot be read by the dna functions - do not use uint, but unsigned int instead, ushort and ulong are allowed - only use a long in Blender if you want this to be the size of a pointer. so it is - 32 bits or 64 bits, dependant at the cpu architecture + 32 bits or 64 bits, dependent at the cpu architecture - chars are always unsigned - aligment of variables has to be done in such a way, that any system does not create 'padding' (gaps) in structures. So make sure that: diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index d39105f3c9d..de84deea3fa 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -382,7 +382,7 @@ extern StructRNA RNA_NlaTrack; extern StructRNA RNA_Node; extern StructRNA RNA_NodeForLoop; extern StructRNA RNA_NodeGroup; -extern StructRNA RNA_NodeImageMultiFileSocket; +extern StructRNA RNA_NodeImageFileSocket; extern StructRNA RNA_NodeLink; extern StructRNA RNA_NodeSocket; extern StructRNA RNA_NodeSocketPanel; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index ddefaa73792..7955c25aa98 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -117,7 +117,7 @@ static int replace_if_different(char *tmpfile, const char *dep_files[]) } - /* XXX, trick to work around dependancy problem + /* XXX, trick to work around dependency problem * assumes dep_files is in the same dir as makesrna.c, which is true for now. */ if(1) { diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 98c6b269b5f..b8e21040c63 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -599,7 +599,7 @@ static void rna_FKeyframe_points_add(FCurve *fcu, int tot) fcu->totvert += tot; while(tot--) { - /* defaults, no userprefs gives pradictable results for API */ + /* defaults, no userprefs gives predictable results for API */ bezt->f1= bezt->f2= bezt->f3= SELECT; bezt->ipo= BEZT_IPO_BEZ; bezt->h1= bezt->h2= HD_AUTO_ANIM; @@ -633,7 +633,7 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) static EnumPropertyItem generator_mode_items[] = { {FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", 0, "Expanded Polynomial", ""}, - {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorised Polynomial", ""}, + {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorized Polynomial", ""}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierGenerator", "FModifier"); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 7059c001283..7e3922a8f81 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -45,7 +45,7 @@ static EnumPropertyItem image_source_items[]= { {IMA_SRC_FILE, "FILE", 0, "Single Image", "Single image file"}, {IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"}, - {IMA_SRC_MOVIE, "MOVIE", 0, "Movie File", "Movie file"}, + {IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"}, {IMA_SRC_GENERATED, "GENERATED", 0, "Generated", "Generated image"}, {IMA_SRC_VIEWER, "VIEWER", 0, "Viewer", "Compositing node viewer"}, {0, NULL, 0, NULL, NULL}}; diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 4375653ecbe..ac03370debf 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -344,7 +344,7 @@ void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall if(ID_REAL_USERS(mb) <= 0) free_libblock(&bmain->mball, mb); else - BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d", + BKE_reportf(reports, RPT_ERROR, "Metaball \"%s\" must have zero users to be removed, found %d", mb->id.name+2, ID_REAL_USERS(mb)); } @@ -1085,7 +1085,7 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataMetaBalls"); srna= RNA_def_struct(brna, "BlendDataMetaBalls", NULL); RNA_def_struct_sdna(srna, "Main"); - RNA_def_struct_ui_text(srna, "Main MetaBalls", "Collection of metaballs"); + RNA_def_struct_ui_text(srna, "Main Metaballs", "Collection of metaballs"); func= RNA_def_function(srna, "new", "rna_Main_metaballs_new"); RNA_def_function_ui_description(func, "Add a new metaball to the main database"); @@ -1098,7 +1098,7 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "remove", "rna_Main_metaballs_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile"); - parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "MetaBall to remove"); + parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_metaballs_tag"); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 7d412fead72..212088849ec 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1462,7 +1462,7 @@ static void rna_def_mpolygon(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_FACESEL); /* faked, actually access to loop vertex values, dont this way because manually setting up vertex/edge per loop is very low level - * instead we setup poly sizes, assign indicies, then calc edges automatic when creating meshes from rna/py */ + * instead we setup poly sizes, assign indices, then calc edges automatic when creating meshes from rna/py */ prop= RNA_def_property(srna, "vertices", PROP_INT, PROP_UNSIGNED); RNA_def_property_array(prop, 3); // eek, this is still used in some cases but infact we dont want to use it at all here. RNA_def_property_flag(prop, PROP_DYNAMIC); diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index 9bee359bbf5..988eaccadb2 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -67,6 +67,7 @@ void RNA_api_mesh(StructRNA *srna) func= RNA_def_function(srna, "update", "ED_mesh_update"); RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges"); + RNA_def_boolean(func, "calc_tessface", 0, "Calculate Tessellation", "Force recalculation of tessellation faces"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); func= RNA_def_function(srna, "unit_test_compare", "rna_Mesh_unit_test_compare"); diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 5f33eac3e8f..a6d256975c0 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -133,7 +133,7 @@ static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, Meta found= BLI_remlink_safe(&mb->elems, ml); if(!found) { - BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" does not contain spline given", mb->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Metaball \"%s\" does not contain spline given", mb->id.name+2); return; } @@ -167,7 +167,7 @@ static void rna_def_metaelement(BlenderRNA *brna) srna= RNA_def_struct(brna, "MetaElement", NULL); RNA_def_struct_sdna(srna, "MetaElem"); - RNA_def_struct_ui_text(srna, "Meta Element", "Blobby element in a MetaBall datablock"); + RNA_def_struct_ui_text(srna, "Meta Element", "Blobby element in a Metaball datablock"); RNA_def_struct_ui_icon(srna, ICON_OUTLINER_DATA_META); /* enums */ diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index b448040e978..021ae87d60b 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -295,7 +295,7 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr) break; } - // update dependancy since a domain - other type switch could have happened + // update dependency since a domain - other type switch could have happened rna_Modifier_dependency_update(bmain, scene, ptr); } @@ -3108,7 +3108,7 @@ void RNA_def_modifier(BlenderRNA *brna) /* flags */ prop= RNA_def_property(srna, "show_viewport", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Realtime); - RNA_def_property_ui_text(prop, "Realtime", "Realtime display of a modifier"); + RNA_def_property_ui_text(prop, "Realtime", "Display modifier in realtime"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index a6a8d9f9a35..01131709f3b 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -245,32 +245,28 @@ static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr) return &RNA_NodeSocket##stypename##idname; \ } - if (sock->struct_type == SOCK_STRUCT_NONE) { + switch (sock->struct_type) { + case SOCK_STRUCT_NONE: switch (sock->type) { case SOCK_FLOAT: NODE_DEFINE_SUBTYPES_FLOAT - break; + break; case SOCK_INT: NODE_DEFINE_SUBTYPES_INT - break; + break; case SOCK_BOOLEAN: return &RNA_NodeSocketBoolean; - break; case SOCK_VECTOR: NODE_DEFINE_SUBTYPES_VECTOR - break; + break; case SOCK_RGBA: return &RNA_NodeSocketRGBA; - break; case SOCK_SHADER: return &RNA_NodeSocketShader; } - } - else { - switch (sock->struct_type) { - case SOCK_STRUCT_OUTPUT_MULTI_FILE: - return &RNA_NodeImageMultiFileSocket; - } + break; + case SOCK_STRUCT_OUTPUT_FILE: + return &RNA_NodeImageFileSocket; } #undef SUBTYPE @@ -332,24 +328,6 @@ static void rna_Matte_t2_set(PointerRNA *ptr, float value) chroma->t2 = value; } -static void rna_Image_start_frame_set(PointerRNA *ptr, int value) -{ - bNode *node= (bNode*)ptr->data; - NodeImageFile *image = node->storage; - - CLAMP(value, MINFRAME, image->efra); - image->sfra= value; -} - -static void rna_Image_end_frame_set(PointerRNA *ptr, int value) -{ - bNode *node= (bNode*)ptr->data; - NodeImageFile *image = node->storage; - - CLAMP(value, image->sfra, MAXFRAME); - image->efra= value; -} - static void rna_Node_scene_set(PointerRNA *ptr, PointerRNA value) { bNode *node= (bNode*)ptr->data; @@ -1770,61 +1748,29 @@ static void def_cmp_render_layers(StructRNA *srna) RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } -static void def_cmp_output_file(StructRNA *srna) -{ - PropertyRNA *prop; - - RNA_def_struct_sdna_from(srna, "NodeImageFile", "storage"); - - prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "File Path", "Output path for the image, same functionality as render output"); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - - prop= RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "im_format"); - RNA_def_property_struct_type(prop, "ImageFormatSettings"); - RNA_def_property_ui_text(prop, "Image Format", ""); - - prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "sfra"); - RNA_def_property_int_funcs(prop, NULL, "rna_Image_start_frame_set", NULL); - RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Start Frame", ""); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - - prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "efra"); - RNA_def_property_int_funcs(prop, NULL, "rna_Image_end_frame_set", NULL); - RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "End Frame", ""); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); -} - -static void rna_def_cmp_output_multi_file_socket(BlenderRNA *brna) +static void rna_def_cmp_output_file_socket(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - srna = RNA_def_struct(brna, "NodeImageMultiFileSocket", "NodeSocketRGBA"); + srna = RNA_def_struct(brna, "NodeImageFileSocket", "NodeSocketRGBA"); RNA_def_struct_sdna(srna, "bNodeSocket"); RNA_def_struct_path_func(srna, "rna_NodeSocket_path"); - RNA_def_struct_ui_text(srna, "Node Image Multi File Socket", "Socket data of multi file output node"); + RNA_def_struct_ui_text(srna, "Node Image File Socket", "Socket data of file output node"); RNA_def_struct_ui_icon(srna, ICON_PLUG); RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); RNA_def_struct_sdna_from(srna, "NodeImageMultiFileSocket", "storage"); - prop = RNA_def_property(srna, "use_render_format", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "use_render_format", 1); - RNA_def_property_ui_text(prop, "Use Render Format", ""); + prop = RNA_def_property(srna, "use_node_format", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "use_node_format", 1); + RNA_def_property_ui_text(prop, "Use Node Format", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_NodeSocket_update"); prop = RNA_def_property(srna, "format", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ImageFormatSettings"); } -static void def_cmp_output_multi_file(StructRNA *srna) +static void def_cmp_output_file(StructRNA *srna) { PropertyRNA *prop; @@ -1845,6 +1791,9 @@ static void def_cmp_output_multi_file(StructRNA *srna) RNA_def_property_int_sdna(prop, NULL, "active_input"); RNA_def_property_ui_text(prop, "Active Input Index", "Active input index in details view list"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "format", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "ImageFormatSettings"); } static void def_cmp_dilate_erode(StructRNA *srna) @@ -3477,7 +3426,7 @@ void RNA_def_nodetree(BlenderRNA *brna) define_specific_node(brna, NODE_FRAME, def_frame); /* special socket types */ - rna_def_cmp_output_multi_file_socket(brna); + rna_def_cmp_output_file_socket(brna); } /* clean up macro definition */ diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h index b336f864012..745a956d831 100644 --- a/source/blender/makesrna/intern/rna_nodetree_types.h +++ b/source/blender/makesrna/intern/rna_nodetree_types.h @@ -113,7 +113,6 @@ DefNode( CompositorNode, CMP_NODE_IMAGE, def_cmp_image, "IMAGE DefNode( CompositorNode, CMP_NODE_R_LAYERS, def_cmp_render_layers, "R_LAYERS", RLayers, "Render Layers", "" ) DefNode( CompositorNode, CMP_NODE_COMPOSITE, 0, "COMPOSITE", Composite, "Composite", "" ) DefNode( CompositorNode, CMP_NODE_OUTPUT_FILE, def_cmp_output_file, "OUTPUT_FILE", OutputFile, "Output File", "" ) -DefNode( CompositorNode, CMP_NODE_OUTPUT_MULTI_FILE, def_cmp_output_multi_file, "OUTPUT_MULTI_FILE", OutputMultiFile, "Output Multi File", "" ) DefNode( CompositorNode, CMP_NODE_TEXTURE, def_texture, "TEXTURE", Texture, "Texture", "" ) DefNode( CompositorNode, CMP_NODE_TRANSLATE, 0, "TRANSLATE", Translate, "Translate", "" ) DefNode( CompositorNode, CMP_NODE_ZCOMBINE, def_cmp_zcombine, "ZCOMBINE", Zcombine, "Z Combine", "" ) diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index ed443f47eb3..433f89309d5 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1829,7 +1829,7 @@ static void rna_def_object(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem drawtype_items[] = { - {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Draw the bounding box of the object"}, + {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Draw the bounds of the object"}, {OB_WIRE, "WIRE", 0, "Wire", "Draw the object as a wireframe"}, {OB_SOLID, "SOLID", 0, "Solid", "Draw the object as a solid (if solid drawing is enabled in the viewport)"}, {OB_TEXTURE, "TEXTURED", 0, "Textured", "Draw the object with textures (if textures are enabled in the viewport)"}, diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index e0e7e3b5bd3..d6783edda42 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1862,7 +1862,7 @@ static void rna_def_unit_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT); - RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs"); + RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs (e.g. 1m 0cm)"); RNA_def_property_update(prop, NC_WINDOW, NULL); } @@ -2814,7 +2814,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations"); RNA_def_property_update(prop, NC_SCENE, NULL); - prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE); + prop= RNA_def_property(srna, "dome_tessellation", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dome.res"); RNA_def_property_ui_range(prop, 1, 8, 1, 1); RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode"); @@ -3533,7 +3533,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"}, {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"}, {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"}, - {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes, optionally showing result"}, + {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes"}, {0, NULL, 0, NULL, NULL}}; /* Bake */ @@ -3760,7 +3760,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS); RNA_def_property_ui_text(prop, "Use Local Coords", - "Vertex coordinates are stored localy on each primitive " + "Vertex coordinates are stored locally on each primitive " "(increases memory usage, but may have impact on speed)"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); @@ -3983,12 +3983,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE); RNA_def_property_ui_text(prop, "Free Image Textures", - "Free all image texture from memory after render, to save memory before compositing"); + "Free all image textures from memory after render, to save memory before compositing"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE); - RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory"); + RNA_def_property_ui_text(prop, "Free Unused Nodes", + "Free Nodes that are not used while compositing, to save memory"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 67304997571..7b747fcd224 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -135,7 +135,7 @@ static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UN ParticleSystem *psys= edit ? edit->psys : NULL; #else /* use this rather than PE_get_current() - because the editing cache is - * dependant on the cache being updated which can happen after this UI + * dependent on the cache being updated which can happen after this UI * draws causing a glitch [#28883] */ ParticleSystem *psys= psys_get_current(ob); #endif diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 170120ea28b..1ca95f96ee5 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2751,7 +2751,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) {2, "OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage"}, #endif #ifdef WITH_JACK - {3, "JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users"}, + {3, "JACK", 0, "Jack", "JACK - Audio Connection Kit, recommended for pro audio users"}, #endif {0, NULL, 0, NULL, NULL}}; diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 087716adbe3..279cda535b1 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -360,7 +360,7 @@ static void rna_def_lighting(BlenderRNA *brna) prop= RNA_def_property(srna, "use_cache", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AOCACHE); - RNA_def_property_ui_text(prop, "Pixel Cache", "Cache AO results in pixels and interpolate over neighbouring pixels for speedup"); + RNA_def_property_ui_text(prop, "Pixel Cache", "Cache AO results in pixels and interpolate over neighboring pixels for speedup"); RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); diff --git a/source/blender/modifiers/MOD_modifiertypes.h b/source/blender/modifiers/MOD_modifiertypes.h index ba2ec56d76a..ea5574a378e 100644 --- a/source/blender/modifiers/MOD_modifiertypes.h +++ b/source/blender/modifiers/MOD_modifiertypes.h @@ -74,7 +74,6 @@ extern ModifierTypeInfo modifierType_WeightVGMix; extern ModifierTypeInfo modifierType_WeightVGProximity; extern ModifierTypeInfo modifierType_DynamicPaint; extern ModifierTypeInfo modifierType_Remesh; -extern ModifierTypeInfo modifierType_NgonInterp; /* MOD_util.c */ void modifier_type_init(ModifierTypeInfo *types[]); diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index 92e50d36b1b..34957670080 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -611,7 +611,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, * we know the surrounding edges are ordered correctly now * so its safe to create vertex normals. * - * calculate vertex normals that can be propodated on lathing + * calculate vertex normals that can be propagated on lathing * use edge connectivity work this out */ if (vc->v[0] >= 0) { if (vc->v[1] >= 0) { diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index 9794635e428..54baa9f9b18 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -52,7 +52,7 @@ #include "MOD_weightvg_util.h" #include "RE_shader_ext.h" /* Texture masking. */ -/* Maps new_w weights in place, using either one of the predifined functions, or a custom curve. +/* Maps new_w weights in place, using either one of the predefined functions, or a custom curve. * Return values are in new_w. * If indices is not NULL, it must be a table of same length as org_w and new_w, mapping to the real * vertex index (in case the weight tables do not cover the whole vertices...). diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.h b/source/blender/modifiers/intern/MOD_weightvg_util.h index 5572628fd3f..ff5727cd403 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.h +++ b/source/blender/modifiers/intern/MOD_weightvg_util.h @@ -58,7 +58,7 @@ struct Tex; */ #define MOD_WVG_ZEROFLOOR 1.0e-32f -/* Maps new_w weights in place, using either one of the predifined functions, or a custom curve. +/* Maps new_w weights in place, using either one of the predefined functions, or a custom curve. * Return values are in new_w. * If indices is not NULL, it must be a table of same length as org_w and new_w, mapping to the real * vertex index (in case the weight tables do not cover the whole vertices...). diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index b458ae3a77d..aabf13f3bb2 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -222,4 +222,8 @@ if(WITH_PYTHON) add_definitions(-DWITH_PYTHON) endif() +if(WITH_IMAGE_OPENEXR) + add_definitions(-DWITH_OPENEXR) +endif() + blender_add_lib(bf_nodes "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/nodes/NOD_composite.h b/source/blender/nodes/NOD_composite.h index e2bbaea8c7f..284b89bc095 100644 --- a/source/blender/nodes/NOD_composite.h +++ b/source/blender/nodes/NOD_composite.h @@ -55,7 +55,6 @@ void register_node_type_cmp_composite(struct bNodeTreeType *ttype); void register_node_type_cmp_viewer(struct bNodeTreeType *ttype); void register_node_type_cmp_splitviewer(struct bNodeTreeType *ttype); void register_node_type_cmp_output_file(struct bNodeTreeType *ttype); -void register_node_type_cmp_output_multi_file(struct bNodeTreeType *ttype); void register_node_type_cmp_view_levels(struct bNodeTreeType *ttype); void register_node_type_cmp_curve_rgb(struct bNodeTreeType *ttype); diff --git a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c index c6462e2870c..fe359372270 100644 --- a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c +++ b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c @@ -79,7 +79,7 @@ static bNodeSocketTemplate cmp_node_bilateralblur_out[]= { dest[x*pix + 2] = mean1[2]*mean0; \ dest[x*pix + 3] = mean1[3]*mean0; -/* initializes deltas for fast access to neighbour pixels */ +/* initializes deltas for fast access to neighbor pixels */ #define INIT_3X3_DELTAS( deltas, step, nch ) \ ((deltas)[0] = (nch), (deltas)[1] = -(step) + (nch), \ (deltas)[2] = -(step), (deltas)[3] = -(step) - (nch), \ diff --git a/source/blender/nodes/composite/nodes/node_composite_defocus.c b/source/blender/nodes/composite/nodes/node_composite_defocus.c index 1e7c8e8b58c..1ff2dac2900 100644 --- a/source/blender/nodes/composite/nodes/node_composite_defocus.c +++ b/source/blender/nodes/composite/nodes/node_composite_defocus.c @@ -462,7 +462,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, // (eg. aa disk blur without test: 112 sec, vs with test: 176 sec...) // iff center blur radius > threshold // and if overlap pixel in focus, do nothing, else add color/weigbt - // (threshold constant is dependant on amount of blur) + // (threshold constant is dependent on amount of blur) #define TESTBG1(c, w) {\ if (ct_crad > nqd->bthresh) {\ if (crad->rect[p] > nqd->bthresh) {\ diff --git a/source/blender/nodes/composite/nodes/node_composite_outputFile.c b/source/blender/nodes/composite/nodes/node_composite_outputFile.c index 66075f1bba4..fc92c3aabc8 100644 --- a/source/blender/nodes/composite/nodes/node_composite_outputFile.c +++ b/source/blender/nodes/composite/nodes/node_composite_outputFile.c @@ -37,107 +37,23 @@ #include "node_composite_util.h" -/* **************** OUTPUT FILE ******************** */ -static bNodeSocketTemplate cmp_node_output_file_in[]= { - { SOCK_RGBA, 1, "Image", 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_FLOAT, 1, "Z", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, - { -1, 0, "" } -}; - -static void node_composit_exec_output_file(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out)) -{ - /* image assigned to output */ - /* stack order input sockets: col, alpha */ - - if(in[0]->data) { - RenderData *rd= data; - NodeImageFile *nif= node->storage; - if(nif->sfra!=nif->efra && (rd->cfra<nif->sfra || rd->cfra>nif->efra)) { - return; /* BAIL OUT RETURN */ - } - else if (!G.rendering) { - /* only output files when rendering a sequence - - * otherwise, it overwrites the output files just - * scrubbing through the timeline when the compositor updates */ - return; - } else { - Main *bmain= G.main; /* TODO, have this passed along */ - CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA); - ImBuf *ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0); - char string[FILE_MAX]; - - ibuf->rect_float= cbuf->rect; - ibuf->dither= rd->dither_intensity; - - if (rd->color_mgt_flag & R_COLOR_MANAGEMENT) - ibuf->profile = IB_PROFILE_LINEAR_RGB; - - if(in[1]->data) { - CompBuf *zbuf= in[1]->data; - if(zbuf->type==CB_VAL && zbuf->x==cbuf->x && zbuf->y==cbuf->y) { - nif->im_format.flag |= R_IMF_FLAG_ZBUF; - ibuf->zbuf_float= zbuf->rect; - } - } - - BKE_makepicstring(string, nif->name, bmain->name, rd->cfra, nif->im_format.imtype, (rd->scemode & R_EXTENSION), TRUE); - - if(0 == BKE_write_ibuf(ibuf, string, &nif->im_format)) - printf("Cannot save Node File Output to %s\n", string); - else - printf("Saved: %s\n", string); - - IMB_freeImBuf(ibuf); - - generate_preview(data, node, cbuf); - - if(in[0]->data != cbuf) - free_compbuf(cbuf); - } - } -} - -static void node_composit_init_output_file(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *ntemp) -{ - RenderData *rd = &ntemp->scene->r; - NodeImageFile *nif= MEM_callocN(sizeof(NodeImageFile), "node image file"); - node->storage= nif; - - BLI_strncpy(nif->name, rd->pic, sizeof(nif->name)); - nif->im_format= rd->im_format; - if (BKE_imtype_is_movie(nif->im_format.imtype)) { - nif->im_format.imtype= R_IMF_IMTYPE_OPENEXR; - } - nif->sfra= rd->sfra; - nif->efra= rd->efra; -} - -void register_node_type_cmp_output_file(bNodeTreeType *ttype) -{ - static bNodeType ntype; - - node_type_base(ttype, &ntype, CMP_NODE_OUTPUT_FILE, "File Output", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS); - node_type_socket_templates(&ntype, cmp_node_output_file_in, NULL); - node_type_size(&ntype, 140, 80, 300); - node_type_init(&ntype, node_composit_init_output_file); - node_type_storage(&ntype, "NodeImageFile", node_free_standard_storage, node_copy_standard_storage); - node_type_exec(&ntype, node_composit_exec_output_file); - - nodeRegisterType(ttype, &ntype); -} +#include "IMB_imbuf.h" +#include "IMB_imbuf_types.h" +#include "intern/openexr/openexr_multi.h" -/* =============================================================================== */ +/* **************** OUTPUT FILE ******************** */ -void ntreeCompositOutputMultiFileAddSocket(bNodeTree *ntree, bNode *node, ImageFormatData *im_format) +bNodeSocket *ntreeCompositOutputFileAddSocket(bNodeTree *ntree, bNode *node, const char *name, ImageFormatData *im_format) { - bNodeSocket *sock = nodeAddSocket(ntree, node, SOCK_IN, "", SOCK_RGBA); + NodeImageMultiFile *nimf = node->storage; + bNodeSocket *sock = nodeAddSocket(ntree, node, SOCK_IN, name, SOCK_RGBA); /* create format data for the input socket */ NodeImageMultiFileSocket *sockdata = MEM_callocN(sizeof(NodeImageMultiFileSocket), "socket image format"); sock->storage = sockdata; - sock->struct_type = SOCK_STRUCT_OUTPUT_MULTI_FILE; + sock->struct_type = SOCK_STRUCT_OUTPUT_FILE; if(im_format) { sockdata->format= *im_format; @@ -145,18 +61,26 @@ void ntreeCompositOutputMultiFileAddSocket(bNodeTree *ntree, bNode *node, ImageF sockdata->format.imtype= R_IMF_IMTYPE_OPENEXR; } } - /* use render data format by default */ - sockdata->use_render_format = 1; + /* use node data format by default */ + sockdata->use_node_format = 1; + + nimf->active_input = BLI_findindex(&node->inputs, sock); + + return sock; } -int ntreeCompositOutputMultiFileRemoveActiveSocket(bNodeTree *ntree, bNode *node) +int ntreeCompositOutputFileRemoveActiveSocket(bNodeTree *ntree, bNode *node) { NodeImageMultiFile *nimf = node->storage; bNodeSocket *sock = BLI_findlink(&node->inputs, nimf->active_input); + int totinputs = BLI_countlist(&node->inputs); if (!sock) return 0; + if (nimf->active_input == totinputs-1) + --nimf->active_input; + /* free format data */ MEM_freeN(sock->storage); @@ -164,19 +88,20 @@ int ntreeCompositOutputMultiFileRemoveActiveSocket(bNodeTree *ntree, bNode *node return 1; } -static void init_output_multi_file(bNodeTree *ntree, bNode* node, bNodeTemplate *ntemp) +static void init_output_file(bNodeTree *ntree, bNode* node, bNodeTemplate *ntemp) { RenderData *rd = &ntemp->scene->r; NodeImageMultiFile *nimf= MEM_callocN(sizeof(NodeImageMultiFile), "node image multi file"); node->storage= nimf; BLI_strncpy(nimf->base_path, rd->pic, sizeof(nimf->base_path)); + nimf->format = rd->im_format; /* add one socket by default */ - ntreeCompositOutputMultiFileAddSocket(ntree, node, &rd->im_format); + ntreeCompositOutputFileAddSocket(ntree, node, "Image", &rd->im_format); } -void free_output_multi_file(bNode *node) +static void free_output_file(bNode *node) { bNodeSocket *sock; @@ -188,7 +113,7 @@ void free_output_multi_file(bNode *node) MEM_freeN(node->storage); } -void copy_output_multi_file(struct bNode *node, struct bNode *target) +static void copy_output_file(struct bNode *node, struct bNode *target) { bNodeSocket *sock, *newsock; @@ -200,52 +125,79 @@ void copy_output_multi_file(struct bNode *node, struct bNode *target) } } -static void exec_output_multi_file(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out)) +static void update_output_file(bNodeTree *UNUSED(ntree), bNode *node) { - RenderData *rd= data; + bNodeSocket *sock; + + /* automatically update the socket type based on linked input */ + for (sock=node->inputs.first; sock; sock=sock->next) { + if (sock->link) { + int linktype = sock->link->fromsock->type; + if (linktype != sock->type) + nodeSocketSetType(sock, linktype); + } + } +} + +/* write input data into individual files */ +static void exec_output_file_singlelayer(RenderData *rd, bNode *node, bNodeStack **in) +{ + Main *bmain= G.main; /* TODO, have this passed along */ NodeImageMultiFile *nimf= node->storage; bNodeSocket *sock; int i; + int has_preview = 0; for (sock=node->inputs.first, i=0; sock; sock=sock->next, ++i) { - if (!in[i]->data) - continue; - - if (!G.rendering) { - /* only output files when rendering a sequence - - * otherwise, it overwrites the output files just - * scrubbing through the timeline when the compositor updates */ - return; - } else { - Main *bmain= G.main; /* TODO, have this passed along */ + if (in[i]->data) { NodeImageMultiFileSocket *sockdata = sock->storage; - CompBuf *cbuf= typecheck_compbuf(in[i]->data, CB_RGBA); - ImBuf *ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0); - ImageFormatData *format = (sockdata->use_render_format ? &rd->im_format : &sockdata->format); + ImageFormatData *format = (sockdata->use_node_format ? &nimf->format : &sockdata->format); char path[FILE_MAX]; - char string[FILE_MAX]; + char filename[FILE_MAX]; + CompBuf *cbuf; + ImBuf *ibuf; - ibuf->rect_float= cbuf->rect; - ibuf->dither= rd->dither_intensity; + switch (format->planes) { + case R_IMF_PLANES_BW: + cbuf = typecheck_compbuf(in[i]->data, CB_VAL); + break; + case R_IMF_PLANES_RGB: + cbuf = typecheck_compbuf(in[i]->data, CB_VEC3); + break; + case R_IMF_PLANES_RGBA: + cbuf = typecheck_compbuf(in[i]->data, CB_RGBA); + break; + } + + ibuf = IMB_allocImBuf(cbuf->x, cbuf->y, format->planes, 0); + /* XXX have to set this explicitly it seems */ + switch (format->planes) { + case R_IMF_PLANES_BW: ibuf->channels = 1; break; + case R_IMF_PLANES_RGB: ibuf->channels = 3; break; + case R_IMF_PLANES_RGBA: ibuf->channels = 4; break; + } + ibuf->rect_float = cbuf->rect; + ibuf->dither = rd->dither_intensity; if (rd->color_mgt_flag & R_COLOR_MANAGEMENT) ibuf->profile = IB_PROFILE_LINEAR_RGB; /* get full path */ BLI_join_dirfile(path, FILE_MAX, nimf->base_path, sock->name); + BKE_makepicstring(filename, path, bmain->name, rd->cfra, format->imtype, (rd->scemode & R_EXTENSION), TRUE); - BKE_makepicstring(string, path, bmain->name, rd->cfra, format->imtype, (rd->scemode & R_EXTENSION), TRUE); - - if(0 == BKE_write_ibuf(ibuf, string, format)) - printf("Cannot save Node File Output to %s\n", string); + if(0 == BKE_write_ibuf(ibuf, filename, format)) + printf("Cannot save Node File Output to %s\n", filename); else - printf("Saved: %s\n", string); + printf("Saved: %s\n", filename); - IMB_freeImBuf(ibuf); + IMB_freeImBuf(ibuf); - #if 0 /* XXX not used yet */ - generate_preview(data, node, cbuf); - #endif + /* simply pick the first valid input for preview */ + if (!has_preview) { + generate_preview(rd, node, cbuf); + has_preview = 1; + } if(in[i]->data != cbuf) free_compbuf(cbuf); @@ -253,16 +205,129 @@ static void exec_output_multi_file(void *data, bNode *node, bNodeStack **in, bNo } } -void register_node_type_cmp_output_multi_file(bNodeTreeType *ttype) +/* write input data into layers */ +static void exec_output_file_multilayer(RenderData *rd, bNode *node, bNodeStack **in) +{ + Main *bmain= G.main; /* TODO, have this passed along */ + NodeImageMultiFile *nimf= node->storage; + void *exrhandle= IMB_exr_get_handle(); + char filename[FILE_MAX]; + bNodeSocket *sock; + int i; + /* Must have consistent pixel size for exr file, simply take the first valid input size. */ + int rectx = -1; + int recty = -1; + int has_preview = 0; + + BKE_makepicstring(filename, nimf->base_path, bmain->name, rd->cfra, R_IMF_IMTYPE_MULTILAYER, (rd->scemode & R_EXTENSION), TRUE); + BLI_make_existing_file(filename); + + for (sock=node->inputs.first, i=0; sock; sock=sock->next, ++i) { + if (in[i]->data) { + CompBuf *cbuf = in[i]->data; + char layname[EXR_LAY_MAXNAME]; + char channelname[EXR_PASS_MAXNAME]; + char *channelname_ext; + + if (cbuf->rect_procedural) { + printf("Error writing multilayer EXR: Procedural buffer not supported\n"); + continue; + } + if (rectx < 0) { + rectx = cbuf->x; + recty = cbuf->y; + } + else if (cbuf->x != rectx || cbuf->y != recty) { + printf("Error: Multilayer EXR output node %s expects same resolution for all input buffers. Layer %s skipped.\n", node->name, sock->name); + continue; + } + + BLI_strncpy(layname, sock->name, sizeof(layname)); + BLI_strncpy(channelname, sock->name, sizeof(channelname)-2); + channelname_ext = channelname + strlen(channelname); + + /* create channels */ + switch (cbuf->type) { + case CB_VAL: + strcpy(channelname_ext, ".V"); + IMB_exr_add_channel(exrhandle, layname, channelname, 1, rectx, cbuf->rect); + break; + case CB_VEC2: + strcpy(channelname_ext, ".X"); + IMB_exr_add_channel(exrhandle, layname, channelname, 2, 2*rectx, cbuf->rect); + strcpy(channelname_ext, ".Y"); + IMB_exr_add_channel(exrhandle, layname, channelname, 2, 2*rectx, cbuf->rect+1); + break; + case CB_VEC3: + strcpy(channelname_ext, ".X"); + IMB_exr_add_channel(exrhandle, layname, channelname, 3, 3*rectx, cbuf->rect); + strcpy(channelname_ext, ".Y"); + IMB_exr_add_channel(exrhandle, layname, channelname, 3, 3*rectx, cbuf->rect+1); + strcpy(channelname_ext, ".Z"); + IMB_exr_add_channel(exrhandle, layname, channelname, 3, 3*rectx, cbuf->rect+2); + break; + case CB_RGBA: + strcpy(channelname_ext, ".R"); + IMB_exr_add_channel(exrhandle, layname, channelname, 4, 4*rectx, cbuf->rect); + strcpy(channelname_ext, ".G"); + IMB_exr_add_channel(exrhandle, layname, channelname, 4, 4*rectx, cbuf->rect+1); + strcpy(channelname_ext, ".B"); + IMB_exr_add_channel(exrhandle, layname, channelname, 4, 4*rectx, cbuf->rect+2); + strcpy(channelname_ext, ".A"); + IMB_exr_add_channel(exrhandle, layname, channelname, 4, 4*rectx, cbuf->rect+3); + break; + } + + /* simply pick the first valid input for preview */ + if (!has_preview) { + generate_preview(rd, node, cbuf); + has_preview = 1; + } + } + } + + /* when the filename has no permissions, this can fail */ + if(IMB_exr_begin_write(exrhandle, filename, rectx, recty, nimf->format.exr_codec)) { + IMB_exr_write_channels(exrhandle); + } + else { + /* TODO, get the error from openexr's exception */ + /* XXX nice way to do report? */ + printf("Error Writing Render Result, see console\n"); + } + + IMB_exr_close(exrhandle); +} + +static void exec_output_file(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out)) +{ + RenderData *rd= data; + NodeImageMultiFile *nimf= node->storage; + + if (!G.rendering) { + /* only output files when rendering a sequence - + * otherwise, it overwrites the output files just + * scrubbing through the timeline when the compositor updates */ + return; + } + + if (nimf->format.imtype==R_IMF_IMTYPE_MULTILAYER) + exec_output_file_multilayer(rd, node, in); + else + exec_output_file_singlelayer(rd, node, in); +} + +void register_node_type_cmp_output_file(bNodeTreeType *ttype) { static bNodeType ntype; - node_type_base(ttype, &ntype, CMP_NODE_OUTPUT_MULTI_FILE, "Multi File Output", NODE_CLASS_OUTPUT, NODE_OPTIONS); + node_type_base(ttype, &ntype, CMP_NODE_OUTPUT_FILE, "File Output", NODE_CLASS_OUTPUT, NODE_OPTIONS|NODE_PREVIEW); node_type_socket_templates(&ntype, NULL, NULL); node_type_size(&ntype, 140, 80, 300); - node_type_init(&ntype, init_output_multi_file); - node_type_storage(&ntype, "NodeImageMultiFile", free_output_multi_file, copy_output_multi_file); - node_type_exec(&ntype, exec_output_multi_file); + node_type_init(&ntype, init_output_file); + node_type_storage(&ntype, "NodeImageMultiFile", free_output_file, copy_output_file); + node_type_update(&ntype, update_output_file, NULL); + node_type_exec(&ntype, exec_output_file); nodeRegisterType(ttype, &ntype); } diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c index d742a916fdf..cde54cfd132 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c +++ b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c @@ -141,11 +141,10 @@ static void node_composit_exec_combhsva(void *UNUSED(data), bNode *node, bNodeSt /* stack order out: 1 rgba channels */ /* stack order in: 4 value channels */ - /* input no image? then only color operation */ + /* input no image? then only color operation in HSV */ if((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) { - out[0]->vec[0] = in[0]->vec[0]; - out[0]->vec[1] = in[1]->vec[0]; - out[0]->vec[2] = in[2]->vec[0]; + hsv_to_rgb(in[0]->vec[0], in[1]->vec[0], in[2]->vec[0], + &out[0]->vec[0], &out[0]->vec[1], &out[0]->vec[2]); out[0]->vec[3] = in[3]->vec[0]; } else { diff --git a/source/blender/nodes/intern/node_util.h b/source/blender/nodes/intern/node_util.h index 98afc319214..6f167e35262 100644 --- a/source/blender/nodes/intern/node_util.h +++ b/source/blender/nodes/intern/node_util.h @@ -65,7 +65,7 @@ ListBase node_internal_connect_default(struct bNodeTree *ntree, struct bNode *no #endif -// this is needed for inlining behaviour +// this is needed for inlining behavior #if defined _WIN32 # define DO_INLINE __inline #elif defined (__sun) || defined (__sun__) diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c index b1e1989da86..e4f21a474c0 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -249,7 +249,7 @@ void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr) { ShaderCallData scd; /* - @note: preserve material from ShadeInput for material id, nodetree execs change it + \note: preserve material from ShadeInput for material id, nodetree execs change it fix for bug "[#28012] Mat ID messy with shader nodes" */ Material *mat = shi->mat; @@ -277,7 +277,7 @@ void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr) ntreeExecThreadNodes(exec, nts, &scd, shi->thread); ntreeReleaseThreadStack(nts); - // @note: set material back to preserved material + // \note: set material back to preserved material shi->mat = mat; /* better not allow negative for now */ if(shr->combined[0]<0.0f) shr->combined[0]= 0.0f; diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 1145fbbd452..65bce912963 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -2040,12 +2040,15 @@ static void bpy_bmesh_dealloc(BPy_BMesh *self) { BMesh *bm = self->bm; - BM_data_layer_free(bm, &bm->vdata, CD_BM_ELEM_PYPTR); - BM_data_layer_free(bm, &bm->edata, CD_BM_ELEM_PYPTR); - BM_data_layer_free(bm, &bm->pdata, CD_BM_ELEM_PYPTR); - BM_data_layer_free(bm, &bm->ldata, CD_BM_ELEM_PYPTR); + /* have have been freed by bmesh */ + if (bm) { + BM_data_layer_free(bm, &bm->vdata, CD_BM_ELEM_PYPTR); + BM_data_layer_free(bm, &bm->edata, CD_BM_ELEM_PYPTR); + BM_data_layer_free(bm, &bm->pdata, CD_BM_ELEM_PYPTR); + BM_data_layer_free(bm, &bm->ldata, CD_BM_ELEM_PYPTR); - bm->py_handle = NULL; + bm->py_handle = NULL; + } PyObject_DEL(self); } @@ -2384,6 +2387,7 @@ PyObject *BPy_BMesh_CreatePyObject(BMesh *bm) else { self = PyObject_New(BPy_BMesh, &BPy_BMesh_Type); self->bm = bm; + bm->py_handle = self; /* point back */ BM_data_layer_add(bm, &bm->vdata, CD_BM_ELEM_PYPTR); BM_data_layer_add(bm, &bm->edata, CD_BM_ELEM_PYPTR); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 2072070102a..ab6d23ba4db 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2470,7 +2470,7 @@ static int pyrna_prop_collection_type_check(BPy_PropertyRNA *self, PyObject *val } /* note: currently this is a copy of 'pyrna_prop_collection_subscript' with - * large blocks commented, we may support slice/key indicies later */ + * large blocks commented, we may support slice/key indices later */ static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self, PyObject *key, PyObject *value) { PYRNA_PROP_CHECK_INT(self); @@ -6500,15 +6500,17 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item py_ret = PyObject_Call(py_func, args_fake, py_kw); - Py_DECREF(args_fake); /* free's py_srna_cobject too */ - if (py_ret) { Py_DECREF(py_ret); + Py_DECREF(args_fake); /* free's py_srna_cobject too */ } else { + /* _must_ print before decreffing args_fake */ PyErr_Print(); PyErr_Clear(); + Py_DECREF(args_fake); /* free's py_srna_cobject too */ + // PyC_LineSpit(); PyErr_Format(PyExc_ValueError, "bpy_struct \"%.200s\" registration error: " diff --git a/source/blender/render/intern/include/gammaCorrectionTables.h b/source/blender/render/intern/include/gammaCorrectionTables.h index b41fc01eaaf..0df4248612b 100644 --- a/source/blender/render/intern/include/gammaCorrectionTables.h +++ b/source/blender/render/intern/include/gammaCorrectionTables.h @@ -37,7 +37,7 @@ #define __GAMMACORRECTIONTABLES_H__ /** - * Initialise the gamma lookup tables + * Initialize the gamma lookup tables */ void makeGammaTables(float gamma); diff --git a/source/blender/render/intern/include/pixelshading.h b/source/blender/render/intern/include/pixelshading.h index 17032283540..c0adc36f3a3 100644 --- a/source/blender/render/intern/include/pixelshading.h +++ b/source/blender/render/intern/include/pixelshading.h @@ -46,7 +46,7 @@ * t[3] - type ZB_POLY or ZB_HALO * t[4] - max. distance * mask is pixel coverage in bits - * @return pointer to the object + * \return pointer to the object */ int shadeHaloFloat(HaloRen *har, float *col, int zz, diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h index c93c4e1da63..c43712ab95e 100644 --- a/source/blender/render/intern/include/rayobject.h +++ b/source/blender/render/intern/include/rayobject.h @@ -89,7 +89,7 @@ typedef struct RayFace { RayObject* RE_rayface_from_vlak(RayFace *face, struct ObjectInstanceRen *obi, struct VlakRen *vlr); /* RayObject representing faces directly from a given VlakRen structure. Thus - allowing to save memory, but making code triangle intersection dependant on + allowing to save memory, but making code triangle intersection dependent on render structures. */ typedef struct VlakPrimitive { diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index b62b18f01e9..9337dc63b62 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -190,7 +190,7 @@ struct Render struct RayObject *raytree; struct RayFace *rayfaces; struct VlakPrimitive *rayprimitives; - float maxdist; /* needed for keeping an incorrect behaviour of SUN and HEMI lights (avoid breaking old scenes) */ + float maxdist; /* needed for keeping an incorrect behavior of SUN and HEMI lights (avoid breaking old scenes) */ /* occlusion tree */ void *occlusiontree; diff --git a/source/blender/render/intern/include/shadbuf.h b/source/blender/render/intern/include/shadbuf.h index ddcfc555f7a..4b3595a009f 100644 --- a/source/blender/render/intern/include/shadbuf.h +++ b/source/blender/render/intern/include/shadbuf.h @@ -42,7 +42,7 @@ struct ObjectRen; /** * Calculates shadowbuffers for a vector of shadow-giving lamps - * @param lar The vector of lamps + * \param lar The vector of lamps */ void makeshadowbuf(struct Render *re, LampRen *lar); void freeshadowbuf(struct LampRen *lar); @@ -52,10 +52,10 @@ void threaded_makeshadowbufs(struct Render *re); /** * Determines the shadow factor for a face and lamp. There is some * communication with global variables here. - * @returns The shadow factors: 1.0 for no shadow, 0.0 for complete - * shadow. - * @param shb The shadowbuffer to find the shadow factor in. - * @param inp The inproduct between viewvector and ? + * \return The shadow factors: 1.0 for no shadow, 0.0 for complete + * shadow. + * \param shb The shadowbuffer to find the shadow factor in. + * \param inp The inproduct between viewvector and ? * */ float testshadowbuf(struct Render *re, struct ShadBuf *shb, const float rco[3], const float dxco[3], const float dyco[3], float inp, float mat_bias); diff --git a/source/blender/render/intern/raytrace/rayobject.cpp b/source/blender/render/intern/raytrace/rayobject.cpp index ef31e730785..26c0105b624 100644 --- a/source/blender/render/intern/raytrace/rayobject.cpp +++ b/source/blender/render/intern/raytrace/rayobject.cpp @@ -282,7 +282,7 @@ MALWAYS_INLINE int isec_tri_quad_neighbour(float start[3], float dir[3], RayFace return 0; } -/* RayFace intersection with checks and neighbour verifaction included, +/* RayFace intersection with checks and neighbor verifaction included, Isect is modified if the face is hit. */ MALWAYS_INLINE int intersect_rayface(RayObject *hit_obj, RayFace *face, Isect *is) @@ -321,7 +321,7 @@ MALWAYS_INLINE int intersect_rayface(RayObject *hit_obj, RayFace *face, Isect *i if(ok) { /* when a shadow ray leaves a face, it can be little outside the edges - of it, causing intersection to be detected in its neighbour face */ + of it, causing intersection to be detected in its neighbor face */ if(is->skip & RE_SKIP_VLR_NEIGHBOUR) { if(dist < 0.1f && is->orig.ob == face->ob) diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 50e3d613ce3..e5833604370 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1592,7 +1592,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if(part->ren_as==PART_DRAW_OB || part->ren_as==PART_DRAW_GR || part->ren_as==PART_DRAW_NOT) return 1; -/* 2. start initialising things */ +/* 2. start initializing things */ /* last possibility to bail out! */ psmd = psys_get_modifier(ob,psys); diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 669355c9977..c9729aecfae 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -1497,7 +1497,7 @@ static int sample_occ_cache(OcclusionTree *tree, float *co, float *n, int x, int else return 0; - /* try to interpolate between 4 neighbouring pixels */ + /* try to interpolate between 4 neighboring pixels */ samples[0]= find_occ_sample(cache, x, y); samples[1]= find_occ_sample(cache, x+cache->step, y); samples[2]= find_occ_sample(cache, x, y+cache->step); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 9ed2d845cf7..daaf1b0c737 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1968,7 +1968,7 @@ static void validate_render_settings(Render *re) if(RE_engine_is_external(re)) { /* not supported yet */ re->r.scemode &= ~(R_EXR_TILE_FILE|R_FULL_SAMPLE); - re->r.mode &= ~R_FIELDS; + re->r.mode &= ~(R_FIELDS|R_MBLUR); } } @@ -2146,7 +2146,7 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie if(re->r.im_format.imtype==R_IMF_IMTYPE_MULTILAYER) { if(re->result) { - RE_WriteRenderResult(re->reports, re->result, name, scene->r.im_format.compress); + RE_WriteRenderResult(re->reports, re->result, name, scene->r.im_format.exr_codec); printf("Saved: %s", name); } } @@ -2181,7 +2181,11 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie RE_ReleaseResultImage(re); BLI_timestr(re->i.lastframetime, name); - printf(" Time: %s\n", name); + printf(" Time: %s", name); + + BLI_exec_cb(G.main, NULL, BLI_CB_EVT_RENDER_STATS); + + fputc('\n', stdout); fflush(stdout); /* needed for renderd !! (not anymore... (ton)) */ return ok; diff --git a/source/blender/render/intern/source/pixelblending.c b/source/blender/render/intern/source/pixelblending.c index 708f46971be..11e8e792159 100644 --- a/source/blender/render/intern/source/pixelblending.c +++ b/source/blender/render/intern/source/pixelblending.c @@ -55,7 +55,7 @@ extern struct Render R; /* ------------------------------------------------------------------------- */ -/* Debug/behaviour defines */ +/* Debug/behavior defines */ /* if defined: alpha blending with floats clips color, as with shorts */ /* #define RE_FLOAT_COLOR_CLIPPING */ /* if defined: alpha values are clipped */ diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index 9746a6dbd86..223c56ef9d6 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -252,8 +252,8 @@ static void render_lighting_halo(HaloRen *har, float col_r[3]) /** * Converts a halo z-buffer value to distance from the camera's near plane - * @param z The z-buffer value to convert - * @return a distance from the camera's near plane in blender units + * \param z The z-buffer value to convert + * \return a distance from the camera's near plane in blender units */ static float haloZtoDist(int z) { @@ -271,13 +271,13 @@ static float haloZtoDist(int z) } /** - * @param col (float[4]) Store the rgb color here (with alpha) + * \param col (float[4]) Store the rgb color here (with alpha) * The alpha is used to blend the color to the background * color_new = (1-alpha)*color_background + color - * @param zz The current zbuffer value at the place of this pixel - * @param dist Distance of the pixel from the center of the halo squared. Given in pixels - * @param xn The x coordinate of the pixel relaticve to the center of the halo. given in pixels - * @param yn The y coordinate of the pixel relaticve to the center of the halo. given in pixels + * \param zz The current zbuffer value at the place of this pixel + * \param dist Distance of the pixel from the center of the halo squared. Given in pixels + * \param xn The x coordinate of the pixel relaticve to the center of the halo. given in pixels + * \param yn The y coordinate of the pixel relaticve to the center of the halo. given in pixels */ int shadeHaloFloat(HaloRen *har, float *col, int zz, float dist, float xn, float yn, short flarec) diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 6c0386cc8b1..38178db5dcb 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -461,7 +461,7 @@ void makeraytree(Render *re) else { //Calculate raytree max_size - //This is ONLY needed to kept a bogus behaviour of SUN and HEMI lights + //This is ONLY needed to kept a bogus behavior of SUN and HEMI lights INIT_MINMAX(min, max); RE_rayobject_merge_bb( re->raytree, min, max ); for(i=0; i<3; i++) @@ -1085,7 +1085,7 @@ static void QMC_initPixel(QMCSampler *qsa, int thread) else { /* SAMP_TYPE_HALTON */ /* generate a new randomised halton sequence per pixel - * to alleviate qmc artifacts and make it reproducable + * to alleviate qmc artifacts and make it reproducible * between threads/frames */ double ht_invprimes[2], ht_nums[2]; double r[2]; diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 49bacbaf693..1e91738c77d 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -3556,6 +3556,8 @@ Material *RE_init_sample_material(Material *orig_mat, Scene *scene) if(mat->mtex[tex_nr]) { MTex *mtex = mat->mtex[tex_nr]; + if(!mtex->tex) continue; + /* only keep compatible texflags */ mtex->texflag = mtex->texflag & (MTEX_RGBTOINT | MTEX_STENCIL | MTEX_NEGATIVE | MTEX_ALPHAMIX); @@ -3629,9 +3631,12 @@ void RE_free_sample_material(Material *mat) if(mat->septex & (1<<tex_nr)) continue; if(mat->mtex[tex_nr]) { MTex *mtex= mat->mtex[tex_nr]; - free_texture(mtex->tex); - MEM_freeN(mtex->tex); - mtex->tex = NULL; + + if(mtex->tex) { + free_texture(mtex->tex); + MEM_freeN(mtex->tex); + mtex->tex = NULL; + } } } diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 0cd5c361499..0e90fbf7536 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -764,7 +764,7 @@ void makeshadowbuf(Render *re, LampRen *lar) if(lar->bufflag & (LA_SHADBUF_AUTO_START|LA_SHADBUF_AUTO_END)) shadowbuf_autoclip(re, lar); - /* just to enforce identical behaviour of all irregular buffers */ + /* just to enforce identical behavior of all irregular buffers */ if(lar->buftype==LA_SHADBUF_IRREGULAR) shb->size= 1024; diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 052f9769b4e..dd9e1df95cd 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -91,7 +91,7 @@ extern struct Render R; */ -/* initialise material variables in shadeinput, +/* initialize material variables in shadeinput, * doing inverse gamma correction where applicable */ void shade_input_init_material(ShadeInput *shi) { diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index ec370bc26fb..fad117d0ea4 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1253,7 +1253,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int /* only shadow lamps shouldn't affect shadow-less materials at all */ if ((lar->mode & LA_ONLYSHADOW) && (!(ma->mode & MA_SHADOW) || !(R.r.mode & R_SHADOW))) return; - /* optimisation, don't render fully black lamps */ + /* optimization, don't render fully black lamps */ if (!(lar->mode & LA_TEXTURE) && (lar->r + lar->g + lar->b == 0.0f)) return; diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index ce5561b3e34..ebcc2ce997f 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -155,7 +155,7 @@ static void load_frame_image_sequence(VoxelData *vd, Tex *tex) ima->source = IMA_SRC_SEQUENCE; iuser.framenr = 1 + iuser.offset; - /* find the first valid ibuf and use it to initialise the resolution of the data set */ + /* find the first valid ibuf and use it to initialize the resolution of the data set */ /* need to do this in advance so we know how much memory to allocate */ ibuf= BKE_image_get_ibuf(ima, &iuser); while (!ibuf && (iuser.framenr < iuser.frames)) { diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 807a3d7d0eb..0727fd6fdd7 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -1032,9 +1032,9 @@ void zbufsinglewire(ZSpan *zspan, int obi, int zvlnr, const float ho1[4], const * This is one of the z buffer fill functions called in zbufclip() and * zbufwireclip(). * - * @param v1 [4 floats, world coordinates] first vertex - * @param v2 [4 floats, world coordinates] second vertex - * @param v3 [4 floats, world coordinates] third vertex + * \param v1 [4 floats, world coordinates] first vertex + * \param v2 [4 floats, world coordinates] second vertex + * \param v3 [4 floats, world coordinates] third vertex */ /* WATCH IT: zbuffillGLinv4 and zbuffillGL4 are identical except for a 2 lines, @@ -1285,9 +1285,9 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, * This is one of the z buffer fill functions called in zbufclip() and * zbufwireclip(). * - * @param v1 [4 floats, world coordinates] first vertex - * @param v2 [4 floats, world coordinates] second vertex - * @param v3 [4 floats, world coordinates] third vertex + * \param v1 [4 floats, world coordinates] first vertex + * \param v2 [4 floats, world coordinates] second vertex + * \param v3 [4 floats, world coordinates] third vertex */ /* now: filling two Z values, the closest and 2nd closest */ @@ -1594,12 +1594,12 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float * * viewspace coordinates. labda = -1 means no clipping, labda in [0, * 1] means a clipping. * Note: uses globals. - * @param v1 start coordinate s - * @param v2 target coordinate t - * @param b1 - * @param b2 - * @param b3 - * @param a index for coordinate (x, y, or z) + * \param v1 start coordinate s + * \param v2 target coordinate t + * \param b1 + * \param b2 + * \param b3 + * \param a index for coordinate (x, y, or z) */ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a, float clipcrop) @@ -1652,11 +1652,11 @@ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a * vertex list of this face. * * - * @param v1 start coordinate s - * @param v2 target coordinate t - * @param b1 - * @param b2 - * @param clve vertex vector. + * \param v1 start coordinate s + * \param v2 target coordinate t + * \param b1 + * \param b2 + * \param clve vertex vector. */ static void makevertpyra(float *vez, float *labda, float **trias, float *v1, float *v2, int *b1, int *clve) @@ -2736,7 +2736,7 @@ static void zbuf_fill_in_rgba(ZSpan *zspan, DrawBufPixel *col, float *v1, float } /* char value==255 is filled in, rest should be zero */ -/* returns alpha values, but sets alpha to 1 for zero alpha pixels that have an alpha value as neighbour */ +/* returns alpha values, but sets alpha to 1 for zero alpha pixels that have an alpha value as neighbor */ void antialias_tagbuf(int xsize, int ysize, char *rectmove) { char *row1, *row2, *row3; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index a7502dd8c22..7f3fd9d1355 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1653,15 +1653,17 @@ static void WM_OT_open_mainfile(wmOperatorType *ot) ot->name= "Open Blender File"; ot->idname= "WM_OT_open_mainfile"; ot->description="Open a Blender file"; - + ot->invoke= wm_open_mainfile_invoke; ot->exec= wm_open_mainfile_exec; /* ommit window poll so this can work in background mode */ - - WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY); + + WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, + WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY); RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file"); - RNA_def_boolean(ot->srna, "use_scripts", 1, "Trusted Source", "Allow blend file execute scripts automatically, default available from system preferences"); + RNA_def_boolean(ot->srna, "use_scripts", 1, "Trusted Source", + "Allow .blend file to execute scripts automatically, default available from system preferences"); } /* **************** link/append *************** */ diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index 0da5301ed5d..a9a12f5a9e0 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -65,7 +65,7 @@ private: public: /* Construct a new canvas. * - * @param area The Blender ARegion to run the game within. + * \param area The Blender ARegion to run the game within. */ KX_BlenderCanvas(struct wmWindow* win, class RAS_Rect &rect, struct ARegion* ar); ~KX_BlenderCanvas(); diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index c4e7fd993c4..4e5852a21c1 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -110,7 +110,7 @@ void BL_MeshDeformer::Relink(CTR_Map<class CTR_HashedPtr, void*>*map) } /** - * @warning This function is expensive! + * \warning This function is expensive! */ void BL_MeshDeformer::RecalcNormals() { diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index d679d1a5792..a730041cdae 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -221,7 +221,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) priority = m_priority; - /* Determine pre-incrementation behaviour and set appropriate flags */ + /* Determine pre-incrementation behavior and set appropriate flags */ switch (m_playtype){ case ACT_ACTION_MOTION: if (bNegativeEvent){ diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp index 9ba79e26f7e..503876b13c7 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.cpp +++ b/source/gameengine/Converter/KX_ConvertControllers.cpp @@ -228,7 +228,7 @@ void BL_ConvertControllers( else { /* We cant do this because importing runs the script which could end up accessing * internal BGE functions, this is unstable while we're converting the scene. - * This is a pitty because its useful to see errors at startup but cant help it */ + * This is a pity because its useful to see errors at startup but cant help it */ // pyctrl->Import(); } diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index 9391d12a3ce..a672e9cd9b8 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -315,7 +315,7 @@ void BL_ConvertSensors(struct Object* blenderobject, bMouseSensor *bmouse = (bMouseSensor *)sens->data; /* There are two main types of mouse sensors. If there is - * no focus-related behaviour requested, we can make do + * no focus-related behavior requested, we can make do * with a basic sensor. This cuts down memory usage and * gives a slight performance gain. */ diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index 726fea795ba..9f0def6e866 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -581,7 +581,7 @@ CExpression* CParser::ProcessText ch = text[0]; /*if (ch != '=') { expr = new CConstExpr(new CStringValue(text)); - *dependant = deplist; + *dependent = deplist; return expr; } else */ diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 26c11cccc7a..4446b40af16 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -34,7 +34,7 @@ public: void Configure(CValue* menuvalue); void Add(CValue* value); - /** @attention not implemented yet :( */ + /** \attention not implemented yet :( */ virtual CValue* Calc(VALUE_OPERATOR op,CValue *val); virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index d50ec0f414e..e772aec28e3 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -217,7 +217,7 @@ PyObject * PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObjec } /** - * @param self A PyObjectPlus_Proxy + * \param self A PyObjectPlus_Proxy */ void PyObjectPlus::py_base_dealloc(PyObject *self) // python wrapper { @@ -295,7 +295,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * } if (attrdef->m_type == KX_PYATTRIBUTE_TYPE_FUNCTION) { - // the attribute has no field correspondance, handover processing to function. + // the attribute has no field correspondence, handover processing to function. if (attrdef->m_getFunction == NULL) return NULL; return (*attrdef->m_getFunction)(ptr, attrdef); diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 49150fc775f..cc7c7f9b281 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -433,7 +433,7 @@ int CValue::GetPropertyCount() double* CValue::GetVector3(bool bGetTransformedVec) { - assertd(false); // don;t get vector from me + assertd(false); // don't get vector from me return m_sZeroVec;//::sZero; } diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 917cf409198..3a81ec05d5b 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -181,7 +181,7 @@ public: * * Together with CExpression, CValue and it's derived classes can be used to * parse expressions into a parsetree with error detecting/correcting capabilities - * also expandible by a CFactory pluginsystem + * also expandable by a CFactory pluginsystem * * Base class for all editor functionality, flexible object type that allows * calculations and uses reference counting for memory management. @@ -316,7 +316,7 @@ public: virtual CValue* FindIdentifier(const STR_String& identifiername); /** Set the wireframe color of this value depending on the CSG * operator type <op> - * @attention: not implemented */ + * \attention: not implemented */ virtual void SetColorOperator(VALUE_OPERATOR op); virtual const STR_String & GetText() = 0; @@ -327,7 +327,7 @@ public: virtual STR_String& GetName() = 0; // Retrieve the name of the value virtual void SetName(const char *name) = 0; // Set the name of the value /** Sets the value to this cvalue. - * @attention this particular function should never be called. Why not abstract? */ + * \attention this particular function should never be called. Why not abstract? */ virtual void SetValue(CValue* newval); virtual CValue* GetReplica() =0; virtual void ProcessReplica(); diff --git a/source/gameengine/GameLogic/SCA_IInputDevice.h b/source/gameengine/GameLogic/SCA_IInputDevice.h index ee9fa97c992..443faef6338 100644 --- a/source/gameengine/GameLogic/SCA_IInputDevice.h +++ b/source/gameengine/GameLogic/SCA_IInputDevice.h @@ -295,7 +295,7 @@ public: virtual int GetNumActiveEvents(); /** - * Get the number of ramping events (just_activated, just_released) + * Get the number of remapping events (just_activated, just_released) */ virtual int GetNumJustEvents(); diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 2a903e4f8b6..09d81c7f14b 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -257,7 +257,7 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr) } } else { - /* First, the pulsing behaviour, if pulse mode is + /* First, the pulsing behavior, if pulse mode is * active. It seems something goes wrong if pulse mode is * not set :( */ if (m_pos_pulsemode) { diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 1e10bcc08fd..3bb29f3f0a2 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -107,7 +107,7 @@ public: ~SCA_ISensor(); virtual void ReParent(SCA_IObject* parent); - /** Because we want sensors to share some behaviour, the Activate has */ + /** Because we want sensors to share some behavior, the Activate has */ /* an implementation on this level. It requires an evaluate on the lower */ /* level of individual sensors. Mapping the old activate()s is easy. */ /* The IsPosTrig() also has to change, to keep things consistent. */ @@ -118,10 +118,10 @@ public: virtual CValue* GetReplica()=0; - /** Set parameters for the pulsing behaviour. - * @param posmode Trigger positive pulses? - * @param negmode Trigger negative pulses? - * @param freq Frequency to use when doing pulsing. + /** Set parameters for the pulsing behavior. + * \param posmode Trigger positive pulses? + * \param negmode Trigger negative pulses? + * \param freq Frequency to use when doing pulsing. */ void SetPulseMode(bool posmode, bool negmode, diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index db34ce4cc15..eecbf2c4183 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -65,7 +65,7 @@ class SCA_JoystickSensor :public SCA_ISensor */ int m_hatf; /** - * The threshold value the axis acts opon + * The threshold value the axis acts upon */ int m_precision; /** diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 97cd01dff38..399ea8d80dd 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -294,7 +294,7 @@ bool SCA_KeyboardSensor::Evaluate() } /* Modify the key state based on qual(s) - * Tested carefuly. dont touch unless your really sure. + * Tested carefully. dont touch unless your really sure. * note, this will only change the results if key modifiers are set. * * When all modifiers and keys are positive diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp index a684ce93aed..c5346c16fc9 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.cpp +++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp @@ -23,7 +23,7 @@ * Contributor(s): none yet. * * ***** END GPL LICENSE BLOCK ***** - * Regulates the top-level logic behaviour for one scene. + * Regulates the top-level logic behavior for one scene. */ /** \file gameengine/GameLogic/SCA_LogicManager.cpp diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h index 8671aa6c796..d0bd49e71af 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.h +++ b/source/gameengine/GameLogic/SCA_LogicManager.h @@ -26,7 +26,7 @@ */ /** \file SCA_IController.h * \ingroup gamelogic - * \brief Regulates the top-level logic behaviour for one scene. + * \brief Regulates the top-level logic behavior for one scene. */ #ifndef __SCA_LOGICMANAGER_H__ #define __SCA_LOGICMANAGER_H__ diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index 59925f44040..0034b5b3f54 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -404,7 +404,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setBoolConst, /* 12. setBoolUniform, */ KX_PYMETHODDEF_DOC_NOARGS(SCA_RandomActuator, setBoolUniform, "setBoolUniform()\n" -"\tSet this generator to produce true and false, each with 50%% chance of occuring\n") +"\tSet this generator to produce true and false, each with 50%% chance of occurring\n") { /* no args */ m_distribution = KX_RANDOMACT_BOOL_UNIFORM; diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp index 82950f571f9..15211247d26 100644 --- a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp +++ b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp @@ -111,7 +111,7 @@ void GPC_Canvas::SetViewPort(int x1, int y1, int x2, int y2) */ /* XXX, nasty, this needs to go somewhere else, - * but where... definitly need to clean up this + * but where... definitely need to clean up this * whole canvas/rendertools mess. */ glEnable(GL_SCISSOR_TEST); diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.h b/source/gameengine/GamePlayer/common/GPC_Canvas.h index e865c662eda..cd2bc7e374e 100644 --- a/source/gameengine/GamePlayer/common/GPC_Canvas.h +++ b/source/gameengine/GamePlayer/common/GPC_Canvas.h @@ -106,7 +106,7 @@ public: virtual void ResizeWindow(int width, int height){}; /** - * @section Methods inherited from abstract base class RAS_ICanvas. + * \section Methods inherited from abstract base class RAS_ICanvas. */ int @@ -157,8 +157,8 @@ public: void ClearColor(float r, float g, float b, float a); /** - * @section Methods inherited from abstract base class RAS_ICanvas. - * Semantics are not yet honoured. + * \section Methods inherited from abstract base class RAS_ICanvas. + * Semantics are not yet honored. */ void SetMouseState(RAS_MouseState mousestate) @@ -176,20 +176,20 @@ public: void ClearBuffer(int type); /** - * @section Services provided by this class. + * \section Services provided by this class. */ /** * Enables display of a banner. * The image data is copied inside. - * @param bannerWidth Display width of the banner. - * @param bannerHeight Display height of the banner. - * @param imageWidth Width of the banner image in pixels. - * @param imageHeight Height of the banner image in pixels. - * @param imageData Pointer to the pixels of the image to display. - * @param alignement Where the banner will be positioned on the canvas. - * @param enabled Whether the banner will be displayed intiallly. - * @return A banner id. + * \param bannerWidth Display width of the banner. + * \param bannerHeight Display height of the banner. + * \param imageWidth Width of the banner image in pixels. + * \param imageHeight Height of the banner image in pixels. + * \param imageData Pointer to the pixels of the image to display. + * \param alignment Where the banner will be positioned on the canvas. + * \param enabled Whether the banner will be displayed initially. + * \return A banner id. */ TBannerId AddBanner( unsigned int bannerWidth, unsigned int bannerHeight, @@ -199,7 +199,7 @@ public: /** * Disposes a banner. - * @param id Bannner to be disposed. + * \param id Banner to be disposed. */ void DisposeBanner(TBannerId id); @@ -210,21 +210,21 @@ public: /** * Enables or disables display of a banner. - * @param id Banner id of the banner to be enabled/disabled. - * @param enabled New state of the banner. + * \param id Banner id of the banner to be enabled/disabled. + * \param enabled New state of the banner. */ void SetBannerEnabled(TBannerId id, bool enabled = true); /** * Enables or disables display of all banners. - * @param enabled New state of the banners. + * \param enabled New state of the banners. */ void SetBannerDisplayEnabled(bool enabled = true); protected: /** * Disposes a banner. - * @param it Bannner to be disposed. + * \param it Banner to be disposed. */ void DisposeBanner(TBannerData& banner); diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.cpp b/source/gameengine/GamePlayer/common/GPC_Engine.cpp index 171ea266f49..6eb52413a4e 100644 --- a/source/gameengine/GamePlayer/common/GPC_Engine.cpp +++ b/source/gameengine/GamePlayer/common/GPC_Engine.cpp @@ -225,7 +225,7 @@ void GPC_Engine::StartLoadingAnimation() } -// will be platform dependant +// will be platform dependent float GPC_Engine::DetermineProgress(void) { #if 0 diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.h b/source/gameengine/GamePlayer/common/GPC_Engine.h index 095efee7895..60f0d2af199 100644 --- a/source/gameengine/GamePlayer/common/GPC_Engine.h +++ b/source/gameengine/GamePlayer/common/GPC_Engine.h @@ -113,7 +113,7 @@ public: bool Loading(void) {return m_loading;} bool Running(void) const {return m_running;} - virtual float DetermineProgress(void); // will be platform dependant + virtual float DetermineProgress(void); // will be platform dependent void UpdateLoadingAnimation(void); private: diff --git a/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h b/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h index ba4213b190c..63e051dd1d4 100644 --- a/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h +++ b/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h @@ -45,7 +45,7 @@ * System independent implementation of SCA_IInputDevice. * System dependent keyboard devices need only to inherit this class * and fill the m_reverseKeyTranslateTable key translation map. - * @see SCA_IInputDevice + * \see SCA_IInputDevice */ class GPC_KeyboardDevice : public SCA_IInputDevice diff --git a/source/gameengine/GamePlayer/common/GPC_MouseDevice.h b/source/gameengine/GamePlayer/common/GPC_MouseDevice.h index c5576d1d234..2db1b1ec34c 100644 --- a/source/gameengine/GamePlayer/common/GPC_MouseDevice.h +++ b/source/gameengine/GamePlayer/common/GPC_MouseDevice.h @@ -41,7 +41,7 @@ /** * Generic Ketsji mouse device. - * @see SCA_IInputDevice + * \see SCA_IInputDevice */ class GPC_MouseDevice : public SCA_IInputDevice { @@ -65,39 +65,39 @@ public: /** * Call this routine to update the mouse device when a button state changes. - * @param button Which button state changes. - * @param isDown The new state of the button. - * @param x Position x-coordinate of the cursor at the time of the state change. - * @param y Position y-coordinate of the cursor at the time of the state change. - * @return Indication as to whether the event was processed. + * \param button Which button state changes. + * \param isDown The new state of the button. + * \param x Position x-coordinate of the cursor at the time of the state change. + * \param y Position y-coordinate of the cursor at the time of the state change. + * \return Indication as to whether the event was processed. */ virtual bool ConvertButtonEvent(TButtonId button, bool isDown); /** * Call this routine to update the mouse device when a button state and * cursor position changes at the same time (e.g. in Win32 messages). - * @param button Which button state changes. - * @param isDown The new state of the button. - * @param x Position x-coordinate of the cursor at the time of the state change. - * @param y Position y-coordinate of the cursor at the time of the state change. - * @return Indication as to whether the event was processed. + * \param button Which button state changes. + * \param isDown The new state of the button. + * \param x Position x-coordinate of the cursor at the time of the state change. + * \param y Position y-coordinate of the cursor at the time of the state change. + * \return Indication as to whether the event was processed. */ virtual bool ConvertButtonEvent(TButtonId button, bool isDown, int x, int y); /** * Call this routine to update the mouse device when the cursor has moved. - * @param x Position x-coordinate of the cursor. - * @param y Position y-coordinate of the cursor. - * @return Indication as to whether the event was processed. + * \param x Position x-coordinate of the cursor. + * \param y Position y-coordinate of the cursor. + * \return Indication as to whether the event was processed. */ virtual bool ConvertMoveEvent(int x, int y); protected: /** * This routine converts a single mouse event to a Ketsji mouse event. - * @param kxevent Ketsji event code. - * @param eventval Value for this event. - * @return Indication as to whether the event was processed. + * \param kxevent Ketsji event code. + * \param eventval Value for this event. + * \return Indication as to whether the event was processed. */ virtual bool ConvertEvent(KX_EnumInputs kxevent, int eventval); }; diff --git a/source/gameengine/GamePlayer/common/GPC_RawImage.h b/source/gameengine/GamePlayer/common/GPC_RawImage.h index 6fa5a9f607b..4d3f45597f8 100644 --- a/source/gameengine/GamePlayer/common/GPC_RawImage.h +++ b/source/gameengine/GamePlayer/common/GPC_RawImage.h @@ -52,16 +52,16 @@ public: /** * Loads the image form the resource into memory. * Converts size of the image and places it with given alignment. - * @param hInstApp The application's instance (location of the resources). - * @param lpName Name of the resource. - * @param lpType Type of the resource. - * @param srcWidth The width of the resource image. - * @param srcHeight The height of the resource image. - * @param width The width of the image created. - * @param height The height of the image created. - * @param alignment How the resource image is located in the image created. - * @param offsetX Amount of horzontal offset applied to the resource image. - * @param offsetY Amount of vertical offset applied to the resource image. + * \param hInstApp The application's instance (location of the resources). + * \param lpName Name of the resource. + * \param lpType Type of the resource. + * \param srcWidth The width of the resource image. + * \param srcHeight The height of the resource image. + * \param width The width of the image created. + * \param height The height of the image created. + * \param alignment How the resource image is located in the image created. + * \param offsetX Amount of horizontal offset applied to the resource image. + * \param offsetY Amount of vertical offset applied to the resource image. */ virtual bool Load(const char *srcName, int destWidth, int destHeight, @@ -70,7 +70,7 @@ public: /** * Returns the width of the image. - * @return The width of the image. + * \return The width of the image. */ virtual int Width() const { @@ -79,7 +79,7 @@ public: /** * Returns the height of the image. - * @return The height of the image. + * \return The height of the image. */ virtual int Height() const { @@ -88,7 +88,7 @@ public: /** * Returns a pointer to the data loaded from the resource. - * @return A pointer to the data loaded from the resource. + * \return A pointer to the data loaded from the resource. */ virtual unsigned char *Data() const { @@ -97,7 +97,7 @@ public: /** * Returns the size of the data loaded from the resource. - * @return The size of the loaded from the resource. + * \return The size of the loaded from the resource. */ virtual int DataSize() const { diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.h b/source/gameengine/GamePlayer/common/GPC_RenderTools.h index 54bf45fc74b..166a931beab 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.h +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.h @@ -77,7 +77,7 @@ public: float* color, double* mat, float aspect); - /* @attention mode is ignored here */ + /* \attention mode is ignored here */ void RenderText2D(RAS_TEXT_RENDER_MODE mode, const char* text, int xco, diff --git a/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.h b/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.h index 57fd0694ec0..8d72a621b6a 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.h +++ b/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.h @@ -44,7 +44,7 @@ * GHOST implementation of GPC_KeyboardDevice. * The contructor fills the keyboard code translation map. * Base class GPC_KeyboardDevice does the rest. - * @see SCA_IInputDevice + * \see SCA_IInputDevice */ class GPG_KeyboardDevice : public GPC_KeyboardDevice { diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 9166f0dded4..36c38682244 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -437,7 +437,7 @@ int main(int argc, char** argv) break; case SCREEN_SAVER_MODE_PASSWORD: /* This is W95 only, which we currently do not support. - Fall-back to normal screen saver behaviour in that case... */ + Fall-back to normal screen saver behavior in that case... */ case SCREEN_SAVER_MODE_SAVER: fullScreen = true; fullScreenParFound = true; diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp index 014641a2d10..8c6392ee825 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp @@ -23,7 +23,7 @@ * Contributor(s): none yet. * * ***** END GPL LICENSE BLOCK ***** - * Ketsji Logic Extenstion: Network Event Manager generic implementation + * Ketsji Logic Extension: Network Event Manager generic implementation */ /** \file gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h index 4f560428fbb..3202785ee81 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h @@ -27,7 +27,7 @@ /** \file KX_NetworkEventManager.h * \ingroup ketsjinet - * \brief Ketsji Logic Extenstion: Network Event Manager class + * \brief Ketsji Logic Extension: Network Event Manager class */ #ifndef __KX_NETWORKEVENTMANAGER_H__ diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index 9d5a6907c46..2741907bfe6 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -23,7 +23,7 @@ * Contributor(s): none yet. * * ***** END GPL LICENSE BLOCK ***** - * Ketsji Logic Extenstion: Network Message Actuator generic implementation + * Ketsji Logic Extension: Network Message Actuator generic implementation */ /** \file gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h index 3c8d8ec23d2..980e1cda6dc 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h @@ -27,7 +27,7 @@ /** \file KX_NetworkMessageActuator.h * \ingroup ketsjinet - * \brief Ketsji Logic Extenstion: Network Message Actuator class + * \brief Ketsji Logic Extension: Network Message Actuator class */ #ifndef __KX_NETWORKMESSAGEACTUATOR_H__ diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index a39c8ede6c1..a69f02baa57 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -23,7 +23,7 @@ * Contributor(s): none yet. * * ***** END GPL LICENSE BLOCK ***** - * Ketsji Logic Extenstion: Network Message Sensor generic implementation + * Ketsji Logic Extension: Network Message Sensor generic implementation */ /** \file gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index 0c76e718fa2..66f723d072c 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -27,7 +27,7 @@ /** \file KX_NetworkMessageSensor.h * \ingroup ketsjinet - * \brief Ketsji Logic Extenstion: Network Message Sensor class + * \brief Ketsji Logic Extension: Network Message Sensor class */ #ifndef __KX_NETWORKMESSAGESENSOR_H__ #define __KX_NETWORKMESSAGESENSOR_H__ diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 082d363fed6..38fc170e371 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -191,7 +191,7 @@ public: void InvalidateProjectionMatrix(bool valid = false); /** Gets the modelview matrix that is used by the rasterizer. - * @warning If the Camera is a dynamic object then this method may return garbage. Use GetCameraToWorld() instead. + * \warning If the Camera is a dynamic object then this method may return garbage. Use GetCameraToWorld() instead. */ const MT_Matrix4x4& GetModelviewMatrix() const; @@ -217,21 +217,21 @@ public: /** * Tests if the given sphere is inside this camera's view frustum. * - * @param center The center of the sphere, in world coordinates. - * @param radius The radius of the sphere. - * @return INSIDE, INTERSECT, or OUTSIDE depending on the sphere's relation to the frustum. + * \param center The center of the sphere, in world coordinates. + * \param radius The radius of the sphere. + * \return INSIDE, INTERSECT, or OUTSIDE depending on the sphere's relation to the frustum. */ int SphereInsideFrustum(const MT_Point3& center, const MT_Scalar &radius); /** * Tests the given eight corners of a box with the view frustum. * - * @param box a pointer to eight MT_Point3 representing the world coordinates of the corners of the box. - * @return INSIDE, INTERSECT, or OUTSIDE depending on the box's relation to the frustum. + * \param box a pointer to eight MT_Point3 representing the world coordinates of the corners of the box. + * \return INSIDE, INTERSECT, or OUTSIDE depending on the box's relation to the frustum. */ int BoxInsideFrustum(const MT_Point3 *box); /** * Tests the given point against the view frustum. - * @return true if the given point is inside or on the view frustum; false if it is outside. + * \return true if the given point is inside or on the view frustum; false if it is outside. */ bool PointInsideFrustum(const MT_Point3& x); diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index ac83200cb2e..610200cc235 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -344,7 +344,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, ci.m_linearDamping = 1.f - shapeprops->m_lin_drag; ci.m_angularDamping = 1.f - shapeprops->m_ang_drag; //need a bit of damping, else system doesn't behave well - ci.m_inertiaFactor = shapeprops->m_inertia/0.4f;//defaults to 0.4, don't want to change behaviour + ci.m_inertiaFactor = shapeprops->m_inertia/0.4f;//defaults to 0.4, don't want to change behavior ci.m_do_anisotropic = shapeprops->m_do_anisotropic; ci.m_anisotropicFriction.setValue(shapeprops->m_friction_scaling[0],shapeprops->m_friction_scaling[1],shapeprops->m_friction_scaling[2]); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index c32dc6c1096..2740a2921d2 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1271,7 +1271,7 @@ const MT_Point3& KX_GameObject::NodeGetLocalPosition() const } -/* Suspend/ resume: for the dynamic behaviour, there is a simple +/* Suspend/ resume: for the dynamic behavior, there is a simple * method. For the residual motion, there is not. I wonder what the * correct solution is for Sumo. Remove from the motion-update tree? * diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index ea721d19179..843fba15725 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -284,7 +284,7 @@ public: ); /** - * @section Stuff which is here due to poor design. + * \section Stuff which is here due to poor design. * Inherited from CValue and needs an implementation. * Do not expect these functions do to anything sensible. */ @@ -324,7 +324,7 @@ public: ); /** - * @section Inherited from CValue. These are the useful + * \section Inherited from CValue. These are the useful * part of the CValue interface that this class implements. */ @@ -428,7 +428,7 @@ public: ); /** - * @return a pointer to the physics controller owned by this class. + * \return a pointer to the physics controller owned by this class. */ KX_IPhysicsController* GetPhysicsController(); @@ -449,7 +449,7 @@ public: } /** - * @return a pointer to the graphic controller owner by this class + * \return a pointer to the graphic controller owner by this class */ PHY_IGraphicController* GetGraphicController() { @@ -466,7 +466,7 @@ public: void ActivateGraphicController(bool recurse); /** - * @section Coordinate system manipulation functions + * \section Coordinate system manipulation functions */ void NodeSetLocalPosition(const MT_Point3& trans ); @@ -496,7 +496,7 @@ public: const MT_Point3& NodeGetLocalPosition( ) const; /** - * @section scene graph node accessor functions. + * \section scene graph node accessor functions. */ SG_Node* GetSGNode( ) @@ -510,7 +510,7 @@ public: } /** - * @section blender object accessor functions. + * \section blender object accessor functions. */ struct Object* GetBlenderObject( ) @@ -572,7 +572,7 @@ public: /** - * @section Physics accessors for this node. + * \section Physics accessors for this node. * * All these calls get passed directly to the physics controller * owned by this object. @@ -673,7 +673,7 @@ public: ); /** - * @section Mesh accessor functions. + * \section Mesh accessor functions. */ /** @@ -829,7 +829,7 @@ public: ) { return m_bIsNegativeScaling; } /** - * @section Logic bubbling methods. + * \section Logic bubbling methods. */ /** @@ -885,7 +885,7 @@ public: #ifdef WITH_PYTHON /** - * @section Python interface functions. + * \section Python interface functions. */ virtual PyObject* py_repr(void) { diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.cpp b/source/gameengine/Ketsji/KX_IPhysicsController.cpp index 62e3c346dd8..bd75246a97f 100644 --- a/source/gameengine/Ketsji/KX_IPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_IPhysicsController.cpp @@ -1,6 +1,4 @@ /* - * @file KX_IPhysicsController.cpp - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -48,5 +46,3 @@ KX_IPhysicsController::KX_IPhysicsController(bool dyna, bool sensor, bool compou KX_IPhysicsController::~KX_IPhysicsController() { } - - diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 29727dc04da..b754e82046f 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -1447,7 +1447,7 @@ void KX_KetsjiEngine::RenderDebugProperties() { STR_String debugtxt; int xcoord = 10; // mmmm, these constants were taken from blender source - int ycoord = 14; // to 'mimic' behaviour + int ycoord = 14; // to 'mimic' behavior float tottime = m_logger->GetAverage(); if (tottime < 1e-6f) { diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index ab3126d90a0..7a29e2a2731 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -279,13 +279,13 @@ public: /** * Sets display of all frames. - * @param bUseFixedTime New setting for display all frames. + * \param bUseFixedTime New setting for display all frames. */ void SetUseFixedTime(bool bUseFixedTime); /** * Returns display of all frames. - * @return Current setting for display all frames. + * \return Current setting for display all frames. */ bool GetUseFixedTime(void) const; @@ -360,35 +360,35 @@ public: /** * Activates or deactivates timing information display. - * @param frameRate Display for frame rate on or off. - * @param profile Display for individual components on or off. - * @param properties Display of scene object debug properties on or off. + * \param frameRate Display for frame rate on or off. + * \param profile Display for individual components on or off. + * \param properties Display of scene object debug properties on or off. */ void SetTimingDisplay(bool frameRate, bool profile, bool properties); /** * Returns status of timing information display. - * @param frameRate Display for frame rate on or off. - * @param profile Display for individual components on or off. - * @param properties Display of scene object debug properties on or off. + * \param frameRate Display for frame rate on or off. + * \param profile Display for individual components on or off. + * \param properties Display of scene object debug properties on or off. */ void GetTimingDisplay(bool& frameRate, bool& profile, bool& properties) const; /** * Sets cursor hiding on every frame. - * @param hideCursor Turns hiding on or off. + * \param hideCursor Turns hiding on or off. */ void SetHideCursor(bool hideCursor); /** * Returns the current setting for cursor hiding. - * @return The current setting for cursor hiding. + * \return The current setting for cursor hiding. */ bool GetHideCursor(void) const; /** * Enables/disables the use of the framing bar color of the Blender file's scenes. - * @param overrideFrameColor The new setting. + * \param overrideFrameColor The new setting. */ void SetUseOverrideFrameColor(bool overrideFrameColor); @@ -399,17 +399,17 @@ public: /** * Set the color used for framing bar color instead of the one in the Blender file's scenes. - * @param r Red component of the override color. - * @param g Green component of the override color. - * @param b Blue component of the override color. + * \param r Red component of the override color. + * \param g Green component of the override color. + * \param b Blue component of the override color. */ void SetOverrideFrameColor(float r, float g, float b); /** * Returns the color used for framing bar color instead of the one in the Blender file's scenes. - * @param r Red component of the override color. - * @param g Green component of the override color. - * @param b Blue component of the override color. + * \param r Red component of the override color. + * \param g Green component of the override color. + * \param b Blue component of the override color. */ void GetOverrideFrameColor(float& r, float& g, float& b) const; @@ -424,7 +424,7 @@ protected: * Processes all scheduled scene activity. * At the end, if the scene lists have changed, * SceneListsChanged(void) is called. - * @see SceneListsChanged(void). + * \see SceneListsChanged(void). */ void ProcessScheduledScenes(void); diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index ed38694d2ca..c8a916e85b6 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -100,7 +100,7 @@ bool KX_MouseFocusSensor::Evaluate() // cout << "evaluate focus mouse sensor "<<endl; m_reset = false; if (m_focusmode) { - /* Focus behaviour required. Test mouse-on. The rest is + /* Focus behavior required. Test mouse-on. The rest is * equivalent to handling a key. */ obHasFocus = ParentObjectHasFocus(); @@ -123,7 +123,7 @@ bool KX_MouseFocusSensor::Evaluate() result = true; } } else { - /* No focus behaviour required: revert to the basic mode. This + /* No focus behavior required: revert to the basic mode. This * mode is never used, because the converter never makes this * sensor for a mouse-key event. It is here for * completeness. */ diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index a4c15fe0968..c8e9dc6b6b7 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -76,7 +76,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor /** - * @attention Overrides default evaluate. + * \attention Overrides default evaluate. */ virtual bool Evaluate(); virtual void Init(); diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index f20a90f7deb..1af8a72c1fd 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -89,7 +89,7 @@ public: /** * Returns the caching information for this material, * This can be used to speed up the rasterizing process. - * @return The caching information. + * \return The caching information. */ virtual TCachingInfo GetCachingInfo(void) const { @@ -100,8 +100,8 @@ public: * Activates the material in the (OpenGL) rasterizer. * On entry, the cachingInfo contains info about the last activated material. * On exit, the cachingInfo should contain updated info about this material. - * @param rasty The rasterizer in which the material should be active. - * @param cachingInfo The information about the material used to speed up rasterizing. + * \param rasty The rasterizer in which the material should be active. + * \param cachingInfo The information about the material used to speed up rasterizing. */ void DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const; virtual bool Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const; @@ -115,7 +115,7 @@ public: /** * Returns the Blender texture face structure that is used for this material. - * @return The material's texture face. + * \return The material's texture face. */ MTFace* GetMTFace(void) const { diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 401474b21a9..7c47fc59ac5 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1720,7 +1720,7 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack * These exist so the current blend dir "//" can always be used to import modules from. * the reason we need a few functions for this is that python is not only used by the game engine * so we cant just add to sys.path all the time, it would leave pythons state in a mess. - * It would also be incorrect since loading blend files for new levels etc would alwasy add to sys.path + * It would also be incorrect since loading blend files for new levels etc would always add to sys.path * * To play nice with blenders python, the sys.path is backed up and the current blendfile along * with all its lib paths are added to the sys path. diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 20743504dad..56127c7b634 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -362,7 +362,7 @@ void KX_Scene::SetFramingType(RAS_FrameSettings & frame_settings) /** * Return a const reference to the framing * type set by the above call. - * The contents are not guarenteed to be sensible + * The contents are not guaranteed to be sensible * if you don't call the above function. */ const RAS_FrameSettings& KX_Scene::GetFramingType() const diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index ca57548be2a..1fa981e18f9 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -53,7 +53,7 @@ #include "RAS_2DFilterManager.h" /** - * @section Forward declarations + * \section Forward declarations */ struct SM_MaterialProps; struct SM_ShapeProps; @@ -181,7 +181,7 @@ protected: KX_WorldInfo* m_worldinfo; /** - * @section Different scenes, linked to ketsji scene + * \section Different scenes, linked to ketsji scene */ /** @@ -191,7 +191,7 @@ protected: NG_NetworkScene* m_networkScene; /** - * A temoprary variable used to parent objects together on + * A temporary variable used to parent objects together on * replication. Don't get confused by the name it is not * the scene's root node! */ @@ -342,7 +342,7 @@ public: void RemoveAnimatedObject(CValue* gameobj); /** - * @section Logic stuff + * \section Logic stuff * Initiate an update of the logic system. */ void LogicBeginFrame(double curtime); @@ -451,7 +451,7 @@ public: /** * Activates new desired canvas width set at design time. - * @param width The new desired width. + * \param width The new desired width. */ void SetCanvasDesignWidth( @@ -459,7 +459,7 @@ public: ); /** * Activates new desired canvas height set at design time. - * @param width The new desired height. + * \param width The new desired height. */ void SetCanvasDesignHeight( @@ -467,7 +467,7 @@ public: ); /** * Returns the current desired canvas width set at design time. - * @return The desired width. + * \return The desired width. */ unsigned int GetCanvasDesignWidth( @@ -476,7 +476,7 @@ public: /** * Returns the current desired canvas height set at design time. - * @return The desired height. + * \return The desired height. */ unsigned int GetCanvasDesignHeight( @@ -495,7 +495,7 @@ public: /** * Return a const reference to the framing * type set by the above call. - * The contents are not guarenteed to be sensible + * The contents are not guaranteed to be sensible * if you don't call the above function. */ @@ -518,7 +518,7 @@ public: const RAS_Rect& GetSceneViewport() const; /** - * @section Accessors to different scenes of this scene + * \section Accessors to different scenes of this scene */ void SetNetworkDeviceInterface(NG_NetworkDeviceInterface* newInterface); void SetNetworkScene(NG_NetworkScene *newScene); diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp index bc8c5ec92a8..f9af9fc3b8e 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp +++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp @@ -536,7 +536,7 @@ PyMethodDef KX_SteeringActuator::Methods[] = { }; PyAttributeDef KX_SteeringActuator::Attributes[] = { - KX_PYATTRIBUTE_INT_RW("behaviour", KX_STEERING_NODEF+1, KX_STEERING_MAX-1, true, KX_SteeringActuator, m_mode), + KX_PYATTRIBUTE_INT_RW("behavior", KX_STEERING_NODEF+1, KX_STEERING_MAX-1, true, KX_SteeringActuator, m_mode), KX_PYATTRIBUTE_RW_FUNCTION("target", KX_SteeringActuator, pyattr_get_target, pyattr_set_target), KX_PYATTRIBUTE_RW_FUNCTION("navmesh", KX_SteeringActuator, pyattr_get_navmesh, pyattr_set_navmesh), KX_PYATTRIBUTE_FLOAT_RW("distance", 0.0f, 1000.0f, KX_SteeringActuator, m_distance), diff --git a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h index f01e405d3df..62b74871603 100644 --- a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h +++ b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h @@ -52,7 +52,7 @@ public: /** * Constructor. - * @param maxNumMesasurements Maximum number of measurements stored (> 1). + * \param maxNumMesasurements Maximum number of measurements stored (> 1). */ KX_TimeCategoryLogger(unsigned int maxNumMeasurements = 10); @@ -73,40 +73,40 @@ public: /** * Adds a category. - * @param category The new category. + * \param category The new category. */ virtual void AddCategory(TimeCategory tc); /** * Starts logging in current measurement for the given category. - * @param tc The category to log to. - * @param now The current time. - * @param endOtherCategories Whether to stop logging to other categories. + * \param tc The category to log to. + * \param now The current time. + * \param endOtherCategories Whether to stop logging to other categories. */ virtual void StartLog(TimeCategory tc, double now, bool endOtherCategories = true); /** * End logging in current measurement for the given category. - * @param tc The category to log to. - * @param now The current time. + * \param tc The category to log to. + * \param now The current time. */ virtual void EndLog(TimeCategory tc, double now); /** * End logging in current measurement for all categories. - * @param now The current time. + * \param now The current time. */ virtual void EndLog(double now); /** * Logs time in next measurement. - * @param now The current time. + * \param now The current time. */ virtual void NextMeasurement(double now); /** * Returns average of all but the current measurement time. - * @return The average of all but the current measurement. + * \return The average of all but the current measurement. */ virtual double GetAverage(TimeCategory tc); diff --git a/source/gameengine/Ketsji/KX_TimeLogger.h b/source/gameengine/Ketsji/KX_TimeLogger.h index 16d97c1fe41..b2336c2c512 100644 --- a/source/gameengine/Ketsji/KX_TimeLogger.h +++ b/source/gameengine/Ketsji/KX_TimeLogger.h @@ -49,7 +49,7 @@ class KX_TimeLogger { public: /** * Constructor. - * @param maxNumMesasurements Maximum number of measurements stored (>1). + * \param maxNumMesasurements Maximum number of measurements stored (>1). */ KX_TimeLogger(unsigned int maxNumMeasurements = 10); @@ -70,25 +70,25 @@ public: /** * Starts logging in current measurement. - * @param now The current time. + * \param now The current time. */ virtual void StartLog(double now); /** * End logging in current measurement. - * @param now The current time. + * \param now The current time. */ virtual void EndLog(double now); /** * Logs time in next measurement. - * @param now The current time. + * \param now The current time. */ virtual void NextMeasurement(double now); /** * Returns average of all but the current measurement. - * @return The average of all but the current measurement. + * \return The average of all but the current measurement. */ virtual double GetAverage(void) const; diff --git a/source/gameengine/Network/NG_NetworkScene.h b/source/gameengine/Network/NG_NetworkScene.h index cd6f9925582..b3ca4df9d50 100644 --- a/source/gameengine/Network/NG_NetworkScene.h +++ b/source/gameengine/Network/NG_NetworkScene.h @@ -105,7 +105,7 @@ protected: /** * Releases messages for the given message map. - * @param map Message map with messages. + * \param map Message map with messages. */ void ClearMessageMap(TMessageMap& map); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 9972f9916b9..cf8a729aa88 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -1566,7 +1566,7 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, MVert *v2= &mvert[mf->v2]; MVert *v3= &mvert[mf->v3]; - // the face indicies + // the face indices tri_pt[0]= vert_remap_array[mf->v1]; tri_pt[1]= vert_remap_array[mf->v2]; tri_pt[2]= vert_remap_array[mf->v3]; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index b9e78d9ff1f..2228b6511ce 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -178,7 +178,7 @@ public: // original mesh that correspond to shape triangles. // only set for concave mesh shape. - std::vector<int> m_triFaceArray; // Contains an array of triplets of face indicies + std::vector<int> m_triFaceArray; // Contains an array of triplets of face indices // quads turn into 2 tris std::vector<UVco> m_triFaceUVcoArray; // Contains an array of pair of UV coordinate for each vertex of faces diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h index f64f55b6592..a2597f917e3 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h @@ -129,7 +129,7 @@ class PHY_IPhysicsEnvironment virtual void setContactBreakingTreshold(float contactBreakingTreshold) {} ///continuous collision detection mode, very experimental for Bullet virtual void setCcdMode(int ccdMode) {} - ///successive overrelaxation constant, in case PSOR is used, values in between 1 and 2 guarantee converging behaviour + ///successive overrelaxation constant, in case PSOR is used, values in between 1 and 2 guarantee converging behavior virtual void setSolverSorConstant(float sor) {} ///setSolverType, internal setting, chooses solvertype, PSOR, Dantzig, impulse based, penalty based virtual void setSolverType(int solverType) {} diff --git a/source/gameengine/PyDoc/API_intro.py b/source/gameengine/PyDoc/API_intro.py deleted file mode 100644 index 097abbfbf1a..00000000000 --- a/source/gameengine/PyDoc/API_intro.py +++ /dev/null @@ -1,110 +0,0 @@ -# This is not a real module, it's simply an introductory text. - -""" -The Blender Game Engine Python API Reference -============================================ - - See U{release notes<http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.49/Game_Engine>} for updates, changes and new functionality in the Game Engine Python API. - - Blender Game Engine Modules: - ---------------------------- - - Modules that include methods for accessing GameEngine data and functions. - - - L{GameLogic} utility functons for game logic. - - L{GameKeys} keyboard input and event conversion. - - L{Rasterizer} display and rendering. - - L{GameTypes} contains all the python types spesific to the GameEngine. - - Modules with documentation in progress: - --------------------- - - L{VideoTexture} - - L{PhysicsConstraints} - - Additional Modules: - ------------------- - - These modules have no GameEngine specific functionality but are useful in many cases. - - - L{mathutils} - - L{Geometry} - - L{BGL} - - -Introduction: -============= - - This reference documents the Blender Python API, a growing collection of - Python modules (libraries) that give access to part of the program's internal - data and functions. - - Through scripting Blender can be extended in real-time via - U{Python <www.python.org>}, an impressive high level, multi-paradigm, open - source language. Newcomers are recommended to start with the tutorial that - comes with it. - - This opens many interesting possibilities not available with logic bricks. - - Game Engine API Stability: - -------------------------- - - When writing python scripts there are a number of situations you should avoid to prevent crashes or unstable behavior. - While the API tries to prevent problems there are some situations where error checking would be too time consuming. - - Known cases: - - Memory Limits. - - There is nothing stopping you from filling a list or making a string so big that that causes blender to run out of memory, in this case python should rasie a MemoryError, but its likely blender will crash before this point. - - - Accessing any data that has been freed. - - For instance accessing a KX_GameObject after its End Object actuator runs. - This will cause a SystemError, however for L{KX_MeshProxy}, L{KX_VertexProxy} and L{KX_VertexProxy} it will crash the blender game engine. - - See: L{GameTypes.PyObjectPlus.invalid} which many types inherit. - - - Mixing L{KX_GameObject} between scenes. - - For instance tracking/parenting an L{KX_GameObject} object to an object from other scene. - - External Modules: - ----------------- - - Since 2.49 support for importing modules has been added. - - This allows you to import any blender textblock with a .py extension. - - External python scripts may be imported as modules when the script is in the same directory as the blend file. - - The current blend files path is included in the sys.path for loading modules. - All linked libraries will also be included so you can be sure when linking in assets from another blend file the scripts will load too. - - A note to newbie script writers: - -------------------------------- - - Interpreted languages are known to be much slower than compiled code, but for - many applications the difference is negligible or acceptable. Also, with - profiling (or even simple direct timing with L{Blender.sys.time<Sys.time>}) to - identify slow areas and well thought optimizations, the speed can be - I{considerably} improved in many cases. Try some of the best BPython scripts - to get an idea of what can be done, you may be surprised. - -@author: The Blender Python Team -@requires: Blender 2.49 or newer. -@version: 2.49 -@see: U{www.blender.org<http://www.blender.org>}: documentation and forum -@see: U{blenderartists.org<http://blenderartists.org>}: user forum -@see: U{projects.blender.org<http://projects.blender.org>} -@see: U{www.python.org<http://www.python.org>} -@see: U{www.python.org/doc<http://www.python.org/doc>} -@see: U{Blending into Python<en.wikibooks.org/wiki/Blender_3D:_Blending_Into_Python>}: User contributed documentation, featuring a blender/python cookbook with many examples. - -@note: the official version of this reference guide is only updated for each - new Blender release. But you can build the current SVN - version yourself: install epydoc, grab all files in the - source/gameengine/PyDoc/ folder of Blender's SVN and use the - epy_docgen.sh script also found there to generate the html docs. - Naturally you will also need a recent Blender binary to try the new - features. If you prefer not to compile it yourself, there is a testing - builds forum at U{blender.org<http://www.blender.org>}. -""" diff --git a/source/gameengine/PyDoc/PhysicsConstraints.py b/source/gameengine/PyDoc/PhysicsConstraints.py deleted file mode 100644 index bec8973edc6..00000000000 --- a/source/gameengine/PyDoc/PhysicsConstraints.py +++ /dev/null @@ -1,293 +0,0 @@ -""" -Documentation for the PhysicsConstraints module. -================================================ - -Example:: - - - # Adding a point constraint # - ############################### - - - # import BGE internal module - import PhysicsConstraints - - # get object list - obj_list = GameLogic.getCurrentScene().objects - - # get object named Obj_1 - root = obj_list["root"] - obj = obj_list["obj"] - - # get object physics ID - phido = obj.getPhysicsId() - - # get root physics ID - phidr = root.getPhysicsId() - - # want to use point constraint type - constraint_type = 1 - - # Use bottom right front corner of object for point constraint position - point_pos_x = 1.0 - point_pos_y = -1.0 - point_pos_z = -1.0 - - # create a point constraint - const = PhysicsConstraints.createConstraint( phido, phidr, constraint_type, point_pos_x, point_pos_y, point_pos_z) - - # stores the new constraint ID to be used later - obj["constraint_ID"] = const.getConstraintId() - - -Example:: - - - # Removing a point constraint # - ################################# - - - # import BGE internal module - import PhysicsConstraints - - # get object list - obj_list = GameLogic.getCurrentScene().objects - - # get object 1 - obj = obj_list["obj"] - - # get constraint ID that was saved as an obj property - # when the constraint was created - constraint_ID = obj["constraint_ID"] - - # remove constraint - PhysicsConstraints.removeConstraint(constraint_ID) - -""" - -def createConstraint(obj_PhysicsID, root_PhysicsID, constraintType, pointPos_x, pointPos_y, pointPos_z, edgePos_x, edgePos_y, edgePos_z, edgeAngle_x, edgeAngle_y, edgeAngle_z): - """ - Create a point constraint between two objects, an edge constraint between two objects, or a vehicle constraint on an object. - - You only have to input the needed parammeters depending on the type of constraint you are trying to create. - - - B{Point Constraint} :: - - While creating a point constraint, the "pointPos" values define where you want the pivot point to be located. - If you are creating a point constraint be sure to assing the integer "1" as the constraintType value. - - Parameters to use: - obj_PhysicsID, root_PhysicsID, constraintType, pointPos_x, pointPos_y, pointPos_z - - B{Edge Constraint} :: - - While creating an edge constraint, the "edgePos" values define where you want the center of the edge constraint to be. - Also, the "edgeAngle" values define in which direction you want the edge constraint to point (As a 3 dimensions vector). - If you want to create an edge constraint be sure to assing the integer "2" as the constraintType value. - - Parameters to use: - obj_PhysicsID, root_PhysicsID, constraintType, edgePos_x, edgePos_y, edgePos_z, edgeAngle_x, edgeAngle_y, edgeAngle_z} - - B{Vehicle Constraint} :: - - While creating a point constraint, the "pointPos" values define where you want the pivot point to be located. - If you want to create an edge constraint be sure to assing the integer "0" as the constraintType value. - - Parameters to use : - obj_PhysicsID, root_PhysicsID, constraintType - - @type obj_PhysicsID: integer - @param obj_PhysicsID: The physic ID of the first object to constraint. - - @type root_PhysicsID: integer - @param root_PhysicsID: The physic ID of the second object to constraint. - - @type constraintType: integer - @param constraintType: The type of constraint. - - @type pointPos_x: float - @param pointPos_x: The X position of the point constraint. - - @type pointPos_y: float - @param pointPos_y: The Y position of the point constraint. - - @type pointPos_z: float - @param pointPos_z: The Z position of the point constraint. - - @type edgePos_x: float - @param edgePos_x: The X value of the center of the edge constraint. - - @type edgePos_y: float - @param edgePos_y: The Y value of the center of the edge constraint. - - @type edgePos_z: float - @param edgePos_z: The Z value of the center of the edge constraint. - - @type edgeAngle_x: float - @param edgeAngle_x: The X value of the edge's orientation vector. - - @type edgeAngle_y: float - @param edgeAngle_y: The Y value of the edge's orientation vector. - - @type edgeAngle_z: float - @param edgeAngle_z: The Z value of the edge's orientation vector. - - @rtype: integer - @return: The created constraint ID - """ - - -def getAppliedImpulse(constraint_ID): - """ - Returns the applied impulse. - - @param constraint_ID: The constraint ID that was saved on the creation of the constraint. - @type constraint_ID: integer - @rtype: float - @return: Measure the stress on a constraint. - """ - - -def getVehicleConstraint(constraint_ID): - """ - Returns the vehicle constraint ID. - - @param constraint_ID: The constraint ID that was saved on the creation of the constraint. - @type constraint_ID: integer - @rtype: integer - """ -def removeConstraint(constraint_ID): - """ - - Removes the constraint between 2 game objects (point and edge constraints). - - It does not remove vehicle constraints. - - @param constraint_ID: The constraint ID that was saved on the creation of the constraint. - @type constraint_ID: integer - """ -def setDeactivationLinearTreshold(linearTreshold): - """ - - Sets the linear velocity that an object must be below before the deactivation timer can start. - - This affects every object in the scene, except for game objects that have 'No sleeping' turned on. - - @param linearTreshold: The linear velocity. - @type linearTreshold: float - """ -def setDeactivationAngularTreshold(angularTreshold): - """ - - Sets the angular velocity that an object must be below before the deactivation timer can start. - - This affects every object in the scene, except for game objects that have 'No sleeping' turned on. - - @param angularTreshold: The angular velocity. - @type angularTreshold: float - """ -def setDeactivationTime(time): - """ - - Time (in seconds) after objects with velocity less then thresholds (see below) are deactivated. - - This affects every object in the scene, except for game objects that have 'No sleeping' turned on. - - This function is directly related with the 2 above functions. - - - @param time: The time in seconds. - @type time: float - """ -def setGravity(gx, gy, gz): - """ - Sets the gravity for the actual scene only. - - All other scenes remain unaffected. - - This affects every object in the scene that has physics enabled. - - @param gx: The force of gravity on world x axis. - @type gx: float - @param gy: The force of gravity on world y axis. - @type gy: float - @param gz: The force of gravity on world z axis. - @type gz: float - """ -def setLinearAirDamping(damping): - """ - - Sets the linear air resistance for all objects in the scene. - - @param damping: The linear air resistance. - @type damping: float - """ -def setNumIterations(numIter): - """ - Sets the number of times an iterative constraint solver is repeated. - - Increasing the number of iterations improves the constraint solver at the cost of performances & the speed of the game engine. - - @param numIter: The number of timesubsteps. (Input 0 to suspend simulation numSubStep) - @type numIter: integer - """ -def setNumTimeSubSteps(numSubStep): - """ - Set the quality of the entire physics simulation including collision detection and constraint solver. - - Increase the number of time substeps to improves the quality of the entire physics simulation at the cost of the performance & the speed of the game engine. - - @param numSubStep: The number of timesubsteps. (Input 0 to suspend simulation numSubStep) - @type numSubStep: integer - """ -#def setDebugMode(): -# """ -# -# -# -# @param numIter: -# @type numIter: -# """ -#def setCcdMode(): -# """ -# Does something -# -# @rtype: -# """ -#def setContactBreakingTreshold(): -# """ -# Does something -# -# @rtype: -# """ -#def setSolverDamping(): -# """ -# Does something -# -# @rtype: -# """ -#def setSolverTau(): -# """ -# Does something -# -# @rtype: -# """ -#def setSolverType(): -# """ -# Does something -# -# @rtype: -# """ -#def setSorConstant(): -# """ -# Does something -# -# @rtype: -# """ -#def setUseEpa(): -# """ -# Does something -# -# @rtype: -# """ diff --git a/source/gameengine/PyDoc/VideoTexture.py b/source/gameengine/PyDoc/VideoTexture.py deleted file mode 100644 index 9d2148d8eaf..00000000000 --- a/source/gameengine/PyDoc/VideoTexture.py +++ /dev/null @@ -1,217 +0,0 @@ -""" -The VideoTexture module allows you to manipulate textures during the game. - -Several sources for texture are possible: video files, image files, -video capture, memory buffer, camera render or a mix of that. - -The video and image files can be loaded from the internet using an URL -instead of a file name. - -In addition, you can apply filters on the images before sending them to the GPU, allowing video effect: blue screen, -color band, gray, normal map. - -VideoTexture uses FFmpeg to load images and videos. All the formats and codecs -that FFmpeg supports are supported by VideoTexture, including but not limited to:: - - * AVI - * Ogg - * Xvid - * Theora - * dv1394 camera - * video4linux capture card (this includes many webcams) - * videoForWindows capture card (this includes many webcams) - * JPG - -The principle is simple: first you identify a texture on an existing object using -the L{materialID} function, then you create a new texture with dynamic content -and swap the two textures in the GPU. - -The GE is not aware of the substitution and continues to display the object as always, -except that you are now in control of the texture. - -When the texture object is deleted, the new texture is deleted and the old texture restored. - -Example:: - import VideoTexture - import GameLogic - - contr = GameLogic.getCurrentController() - obj = contr.owner - - # the creation of the texture must be done once: save the - # texture object in an attribute of GameLogic module makes it persistent - if not hasattr(GameLogic, 'video'): - - # identify a static texture by name - matID = VideoTexture.materialID(obj, 'IMvideo.png') - - # create a dynamic texture that will replace the static texture - GameLogic.video = VideoTexture.Texture(obj, matID) - - # define a source of image for the texture, here a movie - movie = GameLogic.expandPath('//trailer_400p.ogg') - GameLogic.video.source = VideoTexture.VideoFFmpeg(movie) - GameLogic.video.source.scale = True - - # quick off the movie, but it wont play in the background - GameLogic.video.source.play() - - # you need to call this function every frame to ensure update of the texture. - GameLogic.video.refresh(True) - - -""" -def getLastError(): - """ - Returns the description of the last error that occurred in a VideoTexture function. - - @rtype: string - """ -def imageToArray(image,mode): - """ - Returns a BGL.buffer corresponding to the current image stored in a texture source object - - @param image: Image source object. - @type image: object of type L{VideoFFmpeg}, L{ImageFFmpeg}, L{ImageBuff}, L{ImageMix}, L{ImageRender}, L{ImageMirror} or L{ImageViewport} - @param mode: optional argument representing the pixel format. - You can use the characters R, G, B for the 3 color channels, A for the alpha channel, - 0 to force a fixed 0 color channel and 1 to force a fixed 255 color channel. - Example: "BGR" will return 3 bytes per pixel with the Blue, Green and Red channels in that order. \ - "RGB1" will return 4 bytes per pixel with the Red, Green, Blue channels in that order and the alpha channel forced to 255. - The default mode is "RGBA". - @type mode: string - @rtype: BGL.buffer - @returns: object representing the image as one dimensional array of bytes of size (pixel_size*width*height), line by line starting from the bottom of the image. The pixel size and format is determined by the mode parameter. - """ - -def materialID(object,name): - """ - Returns a numeric value that can be used in L{Texture} to create a dynamic texture. - - The value corresponds to an internal material number that uses the texture identified - by name. name is a string representing a texture name with IM prefix if you want to - identify the texture directly. This method works for basic tex face and for material, - provided the material has a texture channel using that particular texture in first - position of the texture stack. name can also have MA prefix if you want to identify - the texture by material. In that case the material must have a texture channel in first - position. - - If the object has no material that matches name, it generates a runtime error. Use try/except to catch the exception. - - Ex: VideoTexture.materialID(obj, 'IMvideo.png') - - @param object: the game object that uses the texture you want to make dynamic - @type object: game object - @param name: name of the texture/material you want to make dynamic. - @type name: string - @rtype: integer - """ -def setLogFile(filename): - """ - Sets the name of a text file in which runtime error messages will be written, in addition to the printing - of the messages on the Python console. Only the runtime errors specific to the VideoTexture module - are written in that file, ordinary runtime time errors are not written. - - @param filename: name of error log file - @type filename: string - @rtype: integer - """ -def FilterBGR24(): - """ - Returns a new input filter object to be used with L{ImageBuff} object when the image passed - to the ImageBuff.load() function has the 3-bytes pixel format BGR. - - @rtype: object of type FilterBGR24 - """ -def FilterBlueScreen(): - """ - Does something - - @rtype: - """ -def FilterColor(): - """ - Does something - - @rtype: - """ -def FilterGray(): - """ - Does something - - @rtype: - """ -def FilterLevel(): - """ - Does something - - @rtype: - """ -def FilterNormal(): - """ - Does something - - @rtype: - """ -def FilterRGB24(): - """ - Returns a new input filter object to be used with L{ImageBuff} object when the image passed - to the ImageBuff.load() function has the 3-bytes pixel format RBG. - - @rtype: object of type FilterRGB24 - """ -def FilterRGBA32(): - """ - Returns a new input filter object to be used with L{ImageBuff} object when the image passed - to the ImageBuff.load() function has the 4-bytes pixel format RGBA. - - @rtype: object of type FilterRGBA32 - """ -def ImageBuff(): - """ - Does something - - @rtype: - """ -def ImageFFmpeg(): - """ - Does something - - @rtype: - """ -def ImageMirror(): - """ - Does something - - @rtype: - """ -def ImageMix(): - """ - Does something - - @rtype: - """ -def ImageRender(): - """ - Does something - - @rtype: - """ -def ImageViewport(): - """ - Does something - - @rtype: - """ -def Texture(): - """ - Does something - - @rtype: L{Texture} - """ -def VideoFFmpeg(): - """ - Does something - - @rtype: - """ diff --git a/source/gameengine/PyDoc/bge_api_validate_py.txt b/source/gameengine/PyDoc/bge_api_validate_py.txt deleted file mode 100644 index ebd74c06bb3..00000000000 --- a/source/gameengine/PyDoc/bge_api_validate_py.txt +++ /dev/null @@ -1,136 +0,0 @@ -#~ This program is free software; you can redistribute it and/or modify -#~ it under the terms of the GNU General Public License as published by -#~ the Free Software Foundation; version 2 of the License. - -#~ This program is distributed in the hope that it will be useful, -#~ but WITHOUT ANY WARRANTY; without even the implied warranty of -#~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#~ GNU General Public License for more details. - -# This script must run from a logic brick so it has access to the game engine api -# it assumes the root blender source directory is the current working directory -# -# Currently it only prints missing modules and methods (not attributes) - -import sys, os - -BGE_API_DOC_PATH = 'source/gameengine/PyDoc' - - -mods = ['GameLogic', 'Rasterizer', 'GameKeys'] -mods_dict = {} -for m in mods: - mods_dict[m] = sys.modules[m] - - -import GameTypes -type_members = {} - -for type_name in dir(GameTypes): - if type_name.startswith('__'): - continue - - type_object = getattr(GameTypes, type_name) - - members = [] - type_members[type_object.__name__] = members - - for member in type_object.__dict__.keys(): - if member.startswith('__'): - continue - - # print type_object.__name__ + '.' + k - members.append(member) - - - -doc_dir= os.path.join(os.getcwd(), BGE_API_DOC_PATH) - -if doc_dir not in sys.path: - sys.path.append(doc_dir) - - -def check_attribute(class_ob, member): - doc = class_ob.__doc__ - if not doc: - return False - - for l in doc.split('\n'): - l = l.strip() - - ''' - @ivar foo: blah blah - to - foo - - ''' - - if l.startswith('@ivar') or l.startswith('@var'): - var = l.split()[1].split(':')[0] - - if var == member: - return True - - return False - - - - - - -print '\n\n\nChecking Docs' - -PRINT_OK = False - -pymod = sys.modules['GameTypes'] -del sys.modules['GameTypes'] # temp remove -mod = __import__('GameTypes') # get the python module -reload(mod) # incase were editing it -sys.modules['GameTypes'] = pymod - -for type_name in sorted(type_members.keys()): - members = type_members[type_name] - - try: - type_class = getattr(mod, type_name) - except: - print "missing class: %s.%s - %s" % (type_name, type_name, str(sorted(members))) - continue - - for member in sorted(members): - try: - getattr(type_class, member) - if PRINT_OK: - print "\tfound: %s.%s" % (type_name, member) - except: - if check_attribute(type_class, member): - if PRINT_OK: - print "\tfound attr: %s.%s" % (type_name, member) - else: - print "\tmissing: %s.%s" % (type_name, member) - - -# Now check the modules -for mod_name, pymod in mods_dict.iteritems(): - print pymod - del sys.modules[mod_name] - - # Now well get the python version - pydoc = __import__(mod_name) - pydoc = reload(pydoc) # avoid using the out dated pyc file only - print pydoc.__file__ - - for member in sorted(dir(pymod)): - if hasattr(pydoc, member) or check_attribute(pydoc, member): - if PRINT_OK: - print "\tfound module attr: %s.%s" % (mod_name, member) - else: - print "\tmissing module attr: %s.%s" % (mod_name, member) - - # Restore real module - sys.modules[mod_name] = pymod - - -sys.path.pop() # remove the pydoc dir from our import paths - - diff --git a/source/gameengine/PyDoc/epy_docgen.sh b/source/gameengine/PyDoc/epy_docgen.sh deleted file mode 100755 index dd30256f42f..00000000000 --- a/source/gameengine/PyDoc/epy_docgen.sh +++ /dev/null @@ -1,16 +0,0 @@ -# epy_docgen.sh -# generates blender python doc using epydoc -# requires epydoc in your PATH. -# run from the doc directory containing the .py files -# usage: sh epy_docgen.sh - -# set posix locale so regex works properly for [A-Z]*.py -LC_ALL=POSIX - -epydoc --debug -v -o BPY_GE --url "http://www.blender.org" --top API_intro \ - --name "Blender GameEngine" --no-private --no-sourcecode --inheritance=included \ - *.py \ - ../../../source/blender/python/api2_2x/doc/BGL.py \ - ../../../source/blender/python/api2_2x/doc/Mathutils.py \ - ../../../source/blender/python/api2_2x/doc/Geometry.py - diff --git a/source/gameengine/PyDoc/how_to_build_win.txt b/source/gameengine/PyDoc/how_to_build_win.txt deleted file mode 100644 index 5610ced3b2a..00000000000 --- a/source/gameengine/PyDoc/how_to_build_win.txt +++ /dev/null @@ -1,16 +0,0 @@ -How To Build the BGE Documentation in Windows -------------------------------------------------------------------------- -1) download and install Python 2.6 - http://www.python.org -2) download and install Epydocs - http://epydoc.sourceforge.net - -* for the following lines we will assume that your installation of Python is in C:\Python26 and epydocs is installed in the default folder Scripts\epydoc. - -3) creates a epy_docgen.bat file in this folder (source\gameengine\PyDoc\) and paste the following line into it: - -:::::: -C:\Python26\python.exe C:\Python26\Scripts\epydoc.py --debug -v -o BPY_GE --url "http://www.blender.org" --top API_intro --name "Blender GameEngine" --no-private --no-sourcecode --inheritance=included *.py ../../../source/blender/python/api2_2x/doc/BGL.py ../../../source/blender/python/api2_2x/doc/Mathutils.py ../../../source/blender/python/api2_2x/doc/Geometry.py -:::::: - -4) run your created batch file. If everything goes well it creates a folder named BPY_GE with all the generated documentation. - -Documentation valid in March of 2010 - Blender 2.5alpha2 diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.h b/source/gameengine/Rasterizer/RAS_FramingManager.h index 4ea2d998190..ddf889aeb37 100644 --- a/source/gameengine/Rasterizer/RAS_FramingManager.h +++ b/source/gameengine/Rasterizer/RAS_FramingManager.h @@ -39,7 +39,7 @@ class RAS_Rect; /** - * @section RAS_FrameSettings + * \section RAS_FrameSettings * This is a value type describing the framing used * by a particular scene in the game engine. * Each KX_Scene contains a RAS_FrameSetting describing @@ -193,7 +193,7 @@ enum RAS_SensorFit }; /** - * @section RAS_FramingManager + * \section RAS_FramingManager * This class helps to compute a view frustum * and a viewport rectangle given the * above settings and a description of the diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h index e35ec1d16d2..b7c26928378 100644 --- a/source/gameengine/Rasterizer/RAS_ICanvas.h +++ b/source/gameengine/Rasterizer/RAS_ICanvas.h @@ -80,8 +80,8 @@ public: * Initializes the canvas for drawing. Drawing to the canvas is * only allowed between BeginDraw() and EndDraw(). * - * @retval false Acquiring the canvas failed. - * @retval true Acquiring the canvas succeeded. + * \retval false Acquiring the canvas failed. + * \retval true Acquiring the canvas succeeded. * */ diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index 0da0b17f6c1..3257682649f 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -135,7 +135,7 @@ public: /** * Returns the caching information for this material, * This can be used to speed up the rasterizing process. - * @return The caching information. + * \return The caching information. */ virtual TCachingInfo GetCachingInfo(void) const { return 0; } @@ -143,8 +143,8 @@ public: * Activates the material in the rasterizer. * On entry, the cachingInfo contains info about the last activated material. * On exit, the cachingInfo should contain updated info about this material. - * @param rasty The rasterizer in which the material should be active. - * @param cachingInfo The information about the material used to speed up rasterizing. + * \param rasty The rasterizer in which the material should be active. + * \param cachingInfo The information about the material used to speed up rasterizing. */ virtual bool Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const { @@ -177,7 +177,7 @@ public: virtual void Replace_IScene(SCA_IScene *val) {}; /* overridden by KX_BlenderMaterial */ /** - * @return the equivalent drawing mode for the material settings (equivalent to old TexFace tface->mode). + * \return the equivalent drawing mode for the material settings (equivalent to old TexFace tface->mode). */ int ConvertFaceMode(struct GameSettings *game, bool image) const; diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index c749868cf79..34ddafbf2cc 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -202,7 +202,7 @@ public: virtual void SetStereoMode(const StereoMode stereomode)=0; /** * Stereo can be used to query if the rasterizer is in stereo mode. - * @return true if stereo mode is enabled. + * \return true if stereo mode is enabled. */ virtual bool Stereo()=0; virtual StereoMode GetStereoMode()=0; @@ -236,7 +236,7 @@ public: /** * IndexPrimitives_3DText will render text into the polygons. - * The text to be rendered is from @param rendertools client object's text property. + * The text to be rendered is from \param rendertools client object's text property. */ virtual void IndexPrimitives_3DText(class RAS_MeshSlot& ms, class RAS_IPolyMaterial* polymat, @@ -247,7 +247,7 @@ public: /** * Set the projection matrix for the rasterizer. This projects * from camera coordinates to window coordinates. - * @param mat The projection matrix. + * \param mat The projection matrix. */ virtual void SetProjectionMatrix(const MT_Matrix4x4 & mat)=0; /** @@ -292,11 +292,11 @@ public: float alpha)=0; /** - * @param drawingmode = KX_BOUNDINGBOX, KX_WIREFRAME, KX_SOLID, KX_SHADED or KX_TEXTURED. + * \param drawingmode = KX_BOUNDINGBOX, KX_WIREFRAME, KX_SOLID, KX_SHADED or KX_TEXTURED. */ virtual void SetDrawingMode(int drawingmode)=0; /** - * @return the current drawing mode: KX_BOUNDINGBOX, KX_WIREFRAME, KX_SOLID, KX_SHADED or KX_TEXTURED. + * \return the current drawing mode: KX_BOUNDINGBOX, KX_WIREFRAME, KX_SOLID, KX_SHADED or KX_TEXTURED. */ virtual int GetDrawingMode()=0; /** @@ -312,13 +312,13 @@ public: virtual double GetTime()=0; /** * Generates a projection matrix from the specified frustum. - * @param left the left clipping plane - * @param right the right clipping plane - * @param bottom the bottom clipping plane - * @param top the top clipping plane - * @param frustnear the near clipping plane - * @param frustfar the far clipping plane - * @return a 4x4 matrix representing the projection transform. + * \param left the left clipping plane + * \param right the right clipping plane + * \param bottom the bottom clipping plane + * \param top the top clipping plane + * \param frustnear the near clipping plane + * \param frustfar the far clipping plane + * \return a 4x4 matrix representing the projection transform. */ virtual MT_Matrix4x4 GetFrustumMatrix( float left, @@ -333,13 +333,13 @@ public: /** * Generates a orthographic projection matrix from the specified frustum. - * @param left the left clipping plane - * @param right the right clipping plane - * @param bottom the bottom clipping plane - * @param top the top clipping plane - * @param frustnear the near clipping plane - * @param frustfar the far clipping plane - * @return a 4x4 matrix representing the projection transform. + * \param left the left clipping plane + * \param right the right clipping plane + * \param bottom the bottom clipping plane + * \param top the top clipping plane + * \param frustnear the near clipping plane + * \param frustfar the far clipping plane + * \return a 4x4 matrix representing the projection transform. */ virtual MT_Matrix4x4 GetOrthoMatrix( float left, diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.h b/source/gameengine/Rasterizer/RAS_IRenderTools.h index 27b328412d2..1d9f7052975 100644 --- a/source/gameengine/Rasterizer/RAS_IRenderTools.h +++ b/source/gameengine/Rasterizer/RAS_IRenderTools.h @@ -103,13 +103,13 @@ public: /** * Renders 3D text string using BFL. - * @param fontid The id of the font. - * @param text The string to render. - * @param size The size of the text. - * @param dpi The resolution of the text. - * @param color The color of the object. - * @param mat The Matrix of the text object. - * @param aspect A scaling factor to compensate for the size. + * \param fontid The id of the font. + * \param text The string to render. + * \param size The size of the text. + * \param dpi The resolution of the text. + * \param color The color of the object. + * \param mat The Matrix of the text object. + * \param aspect A scaling factor to compensate for the size. */ virtual void @@ -125,12 +125,12 @@ public: /** * Renders 2D text string. - * @param mode The type of text - * @param text The string to render. - * @param xco Position on the screen (origin in lower left corner). - * @param yco Position on the screen (origin in lower left corner). - * @param width Width of the canvas to draw to. - * @param height Height of the canvas to draw to. + * \param mode The type of text + * \param text The string to render. + * \param xco Position on the screen (origin in lower left corner). + * \param yco Position on the screen (origin in lower left corner). + * \param width Width of the canvas to draw to. + * \param height Height of the canvas to draw to. */ virtual void diff --git a/source/gameengine/SceneGraph/SG_BBox.h b/source/gameengine/SceneGraph/SG_BBox.h index 08c242baf5d..5096d65558e 100644 --- a/source/gameengine/SceneGraph/SG_BBox.h +++ b/source/gameengine/SceneGraph/SG_BBox.h @@ -117,14 +117,14 @@ public: /** * Get the eight points that define this bounding box. * - * @param world a world transform to apply to the produced points bounding box. + * \param world a world transform to apply to the produced points bounding box. */ void get(MT_Point3 *box, const MT_Transform &world) const; /** * Get the eight points that define this axis aligned bounding box. * This differs from SG_BBox::get() in that the produced box will be world axis aligned. * The maximum & minimum local points will be transformed *before* splitting to 8 points. - * @param world a world transform to be applied. + * \param world a world transform to be applied. */ void getaa(MT_Point3 *box, const MT_Transform &world) const; diff --git a/source/gameengine/SceneGraph/SG_Controller.cpp b/source/gameengine/SceneGraph/SG_Controller.cpp index 5299c865992..07c89dd7af4 100644 --- a/source/gameengine/SceneGraph/SG_Controller.cpp +++ b/source/gameengine/SceneGraph/SG_Controller.cpp @@ -1,5 +1,4 @@ /* - * @file SG_Controller.cpp * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -30,7 +29,6 @@ * \ingroup bgesg */ - #include "SG_Controller.h" void @@ -46,5 +44,3 @@ ClearObject( ){ m_pObject = NULL; } - - diff --git a/source/gameengine/SceneGraph/SG_Controller.h b/source/gameengine/SceneGraph/SG_Controller.h index f6361d2c992..7100debe632 100644 --- a/source/gameengine/SceneGraph/SG_Controller.h +++ b/source/gameengine/SceneGraph/SG_Controller.h @@ -88,12 +88,12 @@ public: /** * Hacky way of passing options to specific controllers - * @param option An integer identifying the option. - * @param value The value of this option. - * @attention This has been placed here to give sca-elements - * @attention some control over the controllers. This is - * @attention necessary because the identity of the controller - * @attention is lost on the way here. + * \param option An integer identifying the option. + * \param value The value of this option. + * \attention This has been placed here to give sca-elements + * \attention some control over the controllers. This is + * \attention necessary because the identity of the controller + * \attention is lost on the way here. */ virtual void diff --git a/source/gameengine/SceneGraph/SG_Node.h b/source/gameengine/SceneGraph/SG_Node.h index d1991537cf9..41133495f2e 100644 --- a/source/gameengine/SceneGraph/SG_Node.h +++ b/source/gameengine/SceneGraph/SG_Node.h @@ -81,7 +81,7 @@ public: ); /** - * Return true if the node is the ancessor of child + * Return true if the node is the ancestor of child */ bool IsAncessor( @@ -91,7 +91,7 @@ public: * Get the current list of children. Do not use this interface for * adding or removing children please use the methods of this class for * that. - * @return a reference to the list of children of this node. + * \return a reference to the list of children of this node. */ NodeList& GetSGChildren() @@ -101,7 +101,7 @@ public: /** * Get the current list of children. - * @return a const reference to the current list of children of this node. + * \return a const reference to the current list of children of this node. */ const NodeList& GetSGChildren() const diff --git a/source/gameengine/SceneGraph/SG_ParentRelation.h b/source/gameengine/SceneGraph/SG_ParentRelation.h index 07f11c87a36..77172256ef9 100644 --- a/source/gameengine/SceneGraph/SG_ParentRelation.h +++ b/source/gameengine/SceneGraph/SG_ParentRelation.h @@ -28,9 +28,9 @@ /** \file SG_ParentRelation.h * \ingroup bgesg - * @page SG_ParentRelationPage SG_ParentRelation + * \page SG_ParentRelationPage SG_ParentRelation - * @section SG_ParentRelationSection SG_ParentRelation + * \section SG_ParentRelationSection SG_ParentRelation * * This is an abstract interface class to the Scene Graph library. * It allows you to specify how child nodes react to parent nodes. diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h index 085c2d12267..32f91103369 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.h +++ b/source/gameengine/SceneGraph/SG_Spatial.h @@ -83,14 +83,14 @@ public: m_ogldirty = false; } /** - * Define the realtionship this node has with it's parent + * Define the relationship this node has with it's parent * node. You should pass an unshared instance of an SG_ParentRelation * allocated on the heap to this method. Ownership of this * instance is assumed by this class. * You may call this function several times in the lifetime * of a node to change the relationship dynamically. * You must call this method before the first call to UpdateSpatialData(). - * An assertion willl be fired at run-time in debug if this is not + * An assertion will be fired at run-time in debug if this is not * the case. * The relation is activated only if no controllers of this object * updated the coordinates of the child. diff --git a/source/gameengine/SceneGraph/SG_Tree.h b/source/gameengine/SceneGraph/SG_Tree.h index b0d74bedec5..dcca1a1442f 100644 --- a/source/gameengine/SceneGraph/SG_Tree.h +++ b/source/gameengine/SceneGraph/SG_Tree.h @@ -81,8 +81,8 @@ public: /** * Gets the eight corners of this treenode's bounding box, * in world coordinates. - * @param box: an array of 8 MT_Point3 - * @example MT_Point3 box[8]; + * \param box: an array of 8 MT_Point3 + * \example MT_Point3 box[8]; * treenode->get(box); */ void get(MT_Point3 *box) const; @@ -127,7 +127,7 @@ public: * It joins pairs of SG_Nodes to minimise the size of the resultant * bounding box. * cf building an optimised Huffman tree. - * @warning O(n^3)!!! + * \warning O(n^3)!!! */ class SG_TreeFactory { diff --git a/source/gameengine/VideoTexture/ImageBase.h b/source/gameengine/VideoTexture/ImageBase.h index e6469f4cb86..cb2187f00ef 100644 --- a/source/gameengine/VideoTexture/ImageBase.h +++ b/source/gameengine/VideoTexture/ImageBase.h @@ -166,7 +166,7 @@ protected: // copy pixel *dstBuff = filter.convert(srcBuff, x, y, srcSize, pixSize); } - // else scale picture (nearest neighbour) + // else scale picture (nearest neighbor) else { // interpolation accumulator diff --git a/source/gameengine/VideoTexture/ImageBuff.cpp b/source/gameengine/VideoTexture/ImageBuff.cpp index d9e3a592f6f..899a9f9782e 100644 --- a/source/gameengine/VideoTexture/ImageBuff.cpp +++ b/source/gameengine/VideoTexture/ImageBuff.cpp @@ -370,7 +370,7 @@ static PyGetSetDef imageBuffGetSets[] = {(char*)"valid", (getter)Image_valid, NULL, (char*)"bool to tell if an image is available", NULL}, {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL}, {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL}, - {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL}, + {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbor)", NULL}, {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL}, {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL}, {NULL} diff --git a/source/gameengine/VideoTexture/ImageMix.cpp b/source/gameengine/VideoTexture/ImageMix.cpp index d06ea485c8c..e2409920230 100644 --- a/source/gameengine/VideoTexture/ImageMix.cpp +++ b/source/gameengine/VideoTexture/ImageMix.cpp @@ -162,7 +162,7 @@ static PyGetSetDef imageMixGetSets[] = {(char*)"valid", (getter)Image_valid, NULL, (char*)"bool to tell if an image is available", NULL}, {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL}, {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL}, - {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL}, + {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbor)", NULL}, {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL}, {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL}, {NULL} diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index a349b45e403..ef371d05f86 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -383,7 +383,7 @@ static PyGetSetDef imageRenderGetSets[] = {(char*)"valid", (getter)Image_valid, NULL, (char*)"bool to tell if an image is available", NULL}, {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL}, {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL}, - {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL}, + {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbor)", NULL}, {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL}, {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL}, {NULL} @@ -545,7 +545,7 @@ static PyGetSetDef imageMirrorGetSets[] = {(char*)"valid", (getter)Image_valid, NULL, (char*)"bool to tell if an image is available", NULL}, {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL}, {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL}, - {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL}, + {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbor)", NULL}, {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL}, {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL}, {NULL} diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp index a9354564d0e..729b9ab9777 100644 --- a/source/gameengine/VideoTexture/ImageViewport.cpp +++ b/source/gameengine/VideoTexture/ImageViewport.cpp @@ -308,7 +308,7 @@ static PyGetSetDef imageViewportGetSets[] = {(char*)"valid", (getter)Image_valid, NULL, (char*)"bool to tell if an image is available", NULL}, {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL}, {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL}, - {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL}, + {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbor)", NULL}, {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL}, {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL}, {NULL} diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index acc09931859..aa8496431d9 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -844,7 +844,7 @@ void VideoFFmpeg::setPositions (void) m_startTime -= double(m_lastFrame) / actFrameRate(); else { m_startTime -= m_range[0]; - // start from begining, stop cache just in case + // start from beginning, stop cache just in case stopCache(); } } @@ -959,7 +959,7 @@ AVFrame *VideoFFmpeg::grabFrame(long position) // of the file. if (position <= m_preseek) { - // we can safely go the begining of the file + // we can safely go the beginning of the file if (av_seek_frame(m_formatCtx, m_videoStream, 0, AVSEEK_FLAG_BYTE) >= 0) { // binary seek does not reset the timestamp, must do it now @@ -1188,7 +1188,7 @@ static PyGetSetDef videoGetSets[] = {(char*)"valid", (getter)Image_valid, NULL, (char*)"bool to tell if an image is available", NULL}, {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL}, {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL}, - {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL}, + {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbor)", NULL}, {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL}, {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL}, {(char*)"preseek", (getter)VideoFFmpeg_getPreseek, (setter)VideoFFmpeg_setPreseek, (char*)"nb of frames of preseek", NULL}, @@ -1309,7 +1309,7 @@ static PyGetSetDef imageGetSets[] = {(char*)"valid", (getter)Image_valid, NULL, (char*)"bool to tell if an image is available", NULL}, {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL}, {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL}, - {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL}, + {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbor)", NULL}, {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL}, {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL}, {NULL} |